Error-Msg: Can't perform operation on active transaction

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
michaelJ
Posts: 30
Joined: Thu 13 Jan 2011 16:11

Error-Msg: Can't perform operation on active transaction

Post by michaelJ » Wed 25 May 2011 11:01

Hello,

can s.o give me an code-example which causes the Error-message 'Can't perform operation on active transaction' that I can reproduce the error?
(I use 'Autocommit=False', so explicit transaction controlling are necessary)

Thanks

Michael

AndreyZ

Post by AndreyZ » Wed 25 May 2011 12:24

Hello,

Such error occurs when you are trying to start a transaction that is already started, or if you are trying to change properties of an active transaction. Here are code examples:

Code: Select all

procedure TMainForm.BitBtnClick(Sender: TObject);
begin
  IBCConnection.AutoCommit := False;
  IBCConnection.Open;
  IBCConnection.StartTransaction;
  IBCConnection.StartTransaction; // error "Can't perform operation on active transaction"
end;

procedure TMainForm.BitBtnClick(Sender: TObject);
begin
  IBCConnection.AutoCommit := False;
  IBCConnection.Open;
  IBCConnection.StartTransaction;
  IBCConnection1.DefaultTransaction.IsolationLevel := iblReadCommitted; // error "Can't perform operation on active transaction"
end;

michaelJ
Posts: 30
Joined: Thu 13 Jan 2011 16:11

Post by michaelJ » Wed 25 May 2011 12:49

Thank you, that help's me very much!

AndreyZ

Post by AndreyZ » Wed 25 May 2011 13:47

Feel free to contact us if you have any further questions about IBDAC.

Post Reply