IsolationLevel problem to set ?

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
RNOVAK
Posts: 26
Joined: Sat 19 Feb 2011 18:30
Contact:

IsolationLevel problem to set ?

Post by RNOVAK » Fri 07 Feb 2014 12:32

Hello

If I have a TMyConnection, and change the IsolationLevel ...

myConn.IsolationLevel := ilReadUnCommitted;

//test to verify on SGDB
qu := TMyQuery.Create(nil);
qu.Connection := myConn;
qu.SQL.Text := 'show variables like ''tx_isolation'';';
qu.Open;
ShowMessage(qu.Fields[1].AsString); <<<-- detection of problem
qu.Close;
//----

myConn.IsolationLevel := ilReadUnCommitted; isn't working at level of database, only on object myConn, the test shows p example 'REPEATABLE-READ'
only if I do manually 'SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;'
than shows 'READ-UNCOMMITED'
or after one first call to myConn.StartTransaction; so works fine

To correct this for a while in my codes, I am doing this sequence
1 - myConn.IsolationLevel := theIsolationLevelIWant;
2 - SQL Manually 'SET SESSION TRANSACTION ISOLATION LEVEL 'theIsolationLevelIWant';'

Well, I think myConn.IsolationLevel := theIsolationLevelIWant must work at SGDB in time of set property on object myConn if myConn.Active. Is it the right ?

Roberto Novakosky

Obs.: with MyDAC Version 8.2.5 on Delphi 2007 (MySQL 5.1 and others)

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: IsolationLevel problem to set ?

Post by AlexP » Wed 12 Feb 2014 16:34

Hello,

For the time being, isolationLevel is set only on the transaction start. We will consider the possibility to change this behavior in one of the next versions.

Post Reply