Page 1 of 1

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

Posted: Wed 25 May 2011 11:01
by michaelJ
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

Posted: Wed 25 May 2011 12:24
by AndreyZ
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;

Posted: Wed 25 May 2011 12:49
by michaelJ
Thank you, that help's me very much!

Posted: Wed 25 May 2011 13:47
by AndreyZ
Feel free to contact us if you have any further questions about IBDAC.