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
krzysiek__m
Posts: 3
Joined: Fri 15 Jul 2011 13:11
Location: Poland

Can't perform operation on active transaction.

Post by krzysiek__m » Fri 15 Jul 2011 13:35

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.

AndreyZ

Post by AndreyZ » Mon 18 Jul 2011 12:30

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.

krzysiek__m
Posts: 3
Joined: Fri 15 Jul 2011 13:11
Location: Poland

Post by krzysiek__m » Mon 18 Jul 2011 13:09

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?

AndreyZ

Post by AndreyZ » Mon 18 Jul 2011 15:33

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.

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

Post by michaelJ » Thu 04 Aug 2011 07:31

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

AndreyZ

Post by AndreyZ » Wed 14 Sep 2011 10:15

MichaelJ, thank you for your help. It is a correct code to use when transactions are started manually.

Post Reply