AutoCommit=False not working
Posted: Tue 30 Aug 2005 23:28
Hello,
The dbExpress driver for Oracle will not honour AutoCommit=False in the connection. It will immediately commit changes rather than wait for a commit to be executed.
I looked at the source code for the driver and, without looking to deeply into the problem, got it working by modifying
Could you confirm the original problem and correctness of the modification?
Sample code to reproduce problem
procedure TForm1.Button2Click(Sender: TObject);
var
connRemote: TSQLConnection;
query1: TSqlQuery;
begin
connRemote := TSQLConnection.Create(nil);
connRemote.KeepConnection := True;
connRemote.DriverName := 'Oracle';
connRemote.GetDriverFunc := 'getSQLDriverORA'; // corelabs
connRemote.LibraryName := 'dbexpoda.dll'; // corelabs
connRemote.VendorLib := 'OCI.DLL';
connRemote.LoginPrompt := False;
connRemote.Params.Values['User_Name'] := 'User_Name';
connRemote.Params.Values['Password'] := 'Password';
connRemote.Params.Values['Database'] := 'Database';
connRemote.Params.Values['AutoCommit'] := 'False';
connRemote.Connected := true;
query1 := TSqlQuery.Create(nil);
query1.SQLConnection := connRemote;
query1.sql.add('update ...');
query1.ExecSQL; // commits the change!!
end;
Thanks,
Mark Klink
Spear Technologies
The dbExpress driver for Oracle will not honour AutoCommit=False in the connection. It will immediately commit changes rather than wait for a commit to be executed.
I looked at the source code for the driver and, without looking to deeply into the problem, got it working by modifying
Could you confirm the original problem and correctness of the modification?
Sample code to reproduce problem
procedure TForm1.Button2Click(Sender: TObject);
var
connRemote: TSQLConnection;
query1: TSqlQuery;
begin
connRemote := TSQLConnection.Create(nil);
connRemote.KeepConnection := True;
connRemote.DriverName := 'Oracle';
connRemote.GetDriverFunc := 'getSQLDriverORA'; // corelabs
connRemote.LibraryName := 'dbexpoda.dll'; // corelabs
connRemote.VendorLib := 'OCI.DLL';
connRemote.LoginPrompt := False;
connRemote.Params.Values['User_Name'] := 'User_Name';
connRemote.Params.Values['Password'] := 'Password';
connRemote.Params.Values['Database'] := 'Database';
connRemote.Params.Values['AutoCommit'] := 'False';
connRemote.Connected := true;
query1 := TSqlQuery.Create(nil);
query1.SQLConnection := connRemote;
query1.sql.add('update ...');
query1.ExecSQL; // commits the change!!
end;
Thanks,
Mark Klink
Spear Technologies