Page 1 of 1

Can't perform operation on active transaction.

Posted: Fri 15 Jul 2011 13:35
by krzysiek__m
Very often in my application this error occurs. Here's an example snippet. The code is called periodically by the timer. I use a separate transaction, and the database connection has autocommit set to false.
After error each query connected to a database generates that error.
It seems to me that the error occurs after some time of user inactivity (the application in the taskbar).

Example code:
if datamodule1.fakt_przek_list.Active then datamodule1.fakt_przek_list.Close;
datamodule1.fakt_przek_list.ParamByName('DZIAL').AsString := g_uzyt_dzial;
datamodule1.fakt_przek_list.Open; //ERROR Can't perform operation on active transaction.

Posted: Mon 18 Jul 2011 12:30
by AndreyZ
Hello,

Please take a look at this topic: http://www.devart.com/forums/viewtopic.php?t=21092 . There you will find information about situations in which such error occurs.

Posted: Mon 18 Jul 2011 13:09
by krzysiek__m
I've tried the connection where Autocommit is set to true or false. The error still occurs. I do not change a transaction settings in the code.
The error occurs when opening the query. How to locate the cause?

Posted: Mon 18 Jul 2011 15:33
by AndreyZ
I cannot reproduce the problem. Please try composing a small sample to demonstrate the problem and send it to andreyz*devart*com, including a script to create server objects. Also please specify the following:
- the exact version of IBDAC. You can learn it from the About sheet of TIBCConnection Editor;
- the exact version of your IDE;
- the exact version of Firebird or InterBase you are using.

Posted: Thu 04 Aug 2011 07:31
by michaelJ
Hello,

maybe this helps when you manually start a transaction, because it couldn't start twice:

Code: Select all


   if not DM.IBCTRANSACTION.Active then DM.IBCTRANSACTION.StartTransaction;
MichaelJ

Posted: Wed 14 Sep 2011 10:15
by AndreyZ
MichaelJ, thank you for your help. It is a correct code to use when transactions are started manually.