Subject Re: [firebird-support] logging transaction identifier
Author Alexandre Benson Smith
markpollard15222 wrote:
> I am attempting to debug an 'open transaction' issue. I've been using
> 'gstat -h' to track the gap between the oldest and next transactions.
> Sure enough, the oldest transaction is stuck.
>
> I would like to correlate the SQL statements that are being executed
> with the transaction identifier output by 'gstat -h'. Is there a way
> to retrieve the current/most recent transaction identifier? I would
> then have the program log both the SQL statement and its transaction
> identifier.
>
> Firebird 1.5.3.4870 is being used. Complicating the matter, hibernate
> and jaybird are also being used. But, answers in the abstract or very
> concrete (such as direct SQL) would be appreciated. Thank you.
>

in FB 1.5.X you should use CURRENT_TRANSACTION

in FB 2.0 you could use CURRENT_TRANSACTION or GET_CONTEXT function.

select CURRENT_TRANSACTION from rdb$database

see you !

--
Alexandre Benson Smith
Development
THOR Software e Comercial Ltda
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br