I have a problem with nested transactions with Oracle 12.2c driver version 6.10.15.0
For example:
I call function BeginTransaction from the SQLConnection. then I want to start a nested transaction then get an error Transaction is already active, but for example, when I use driver 4.20.0.8, the error does not appear.
Can anyone help, please?
I wrote a simple example with two buttons which start the new transactions, firstly I click one button then second. and got an error:
Code:
Code: Select all
unit uMain;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, cxGraphics, cxLookAndFeels, cxLookAndFeelPainters, Menus, StdCtrls, cxButtons,uDM,DBXCommon;
type
TfMain = class(TForm)
btnStartFirstTransaction: TcxButton;
btnStartSecondTransaction: TcxButton;
procedure btnStartFirstTransactionClick(Sender: TObject);
procedure btnStartSecondTransactionClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
fMain: TfMain;
implementation
{$R *.dfm}
procedure TfMain.btnStartFirstTransactionClick(Sender: TObject);
begin
fDM.MainConnection.BeginTransaction;
end;
procedure TfMain.btnStartSecondTransactionClick(Sender: TObject);
begin
fDM.MainConnection.BeginTransaction;
end;
end.
Code: Select all
unit uDM;
interface
uses
SysUtils, Classes, WideStrings, DB, SqlExpr;
type
TfDM = class(TDataModule)
MainConnection: TSQLConnection;
private
{ Private declarations }
public
{ Public declarations }
end;
var
fDM: TfDM;
implementation
{$R *.dfm}
end.
Looks like a bug, I thought that databases support nested transactions.
Thanks.