Page 1 of 1

check if in transaction

Posted: Mon 03 Oct 2011 02:10
by inageib
Hi,
how I can check if db is in transaction ?

thaks

Posted: Tue 04 Oct 2011 10:32
by AndreyZ
You can check if there are active transactions using the following code:

Code: Select all

if IBCConnection.InTransaction then
  ShowMessage('There are active transactions');

Posted: Tue 04 Oct 2011 13:29
by inageib
thanks alot I was trying with the transaction component :)

Posted: Thu 06 Oct 2011 09:01
by AndreyZ
InterBase and Firebird support multiple transactions through one connection. When you are checking the TIBCTransaction.Active property, you are checking only if this transaction is active. The TIBCConnection.InTransaction method indicates if there are any active transations (explicit or implicit) that are active and which work through this connection.

Posted: Thu 06 Oct 2011 14:20
by inageib
THANKS ALOT MY FRIEND