IsolationLevel problem to set ?
Posted: 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)
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)