Check if theres any connection with active transaction is possible?

Hi.

I have a background doing some staff on some tables. My main db is firebird so i have some deadlocks because happens the background task try to change a record in a active transaction of the foreground task.

Now, i theres a way to check if the connection manager has some transaction in course,i just can say on my foreground task and wait for no active transaction on the main task.

Is possible to ask to connection manager for active transactions?

Best regards.

Connection manager has no such features, but you can use OnConnectionAcquired event of ConnectionManager for storing connection object into list and OnConnectionReleased event for removing it.

I recommend to store object instead of connection because the RefCount property of interface won’t be increased. later you can call Supports and receive required interface.

@EvgenyK i think connection acquired not means transaction started, right?

Theres some point where i can count the transaction stared versus transaction commit/rollback?

check IDAConnection.InTransaction.

@EvgenyK thanks. i will then navigate all the connections in a connection manager and check in transaction property. Thanks!