Skip site navigation (1) Skip section navigation (2)

Re: determining if there's a transaction in progress

From: Björn Lundin <bjorn(dot)lundin(at)swipnet(dot)se>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: determining if there's a transaction in progress
Date: 2002-08-19 08:54:58
Message-ID: ajqbnu$25ma$ (view raw, whole thread or download thread mbox)
Lists: pgsql-interfaces
Warren W. Gay VE3WWG wrote:

> I too could benefit from a libpq feature that indicates if a transaction
> is pending. This
> helps in determining in a destructor (or Ada finalization) whether the
> default action
> to rollback/commit is necessary (rather than depend upon the server
> default action).
> Assuming it is always necessary is clumsy, and imposes unnecessary
> overhead in
> situations where a transaction may not be in progress.

In Ada, you could keep track of transaction state in a package.
Put 'start_trans', 'commit' and 'rollback' procedures that changes the 
transaction state accordingly. You'll then need a function 
'trans_in_progress' to check it

Example at


In response to

pgsql-interfaces by date

Next:From: Frédéric BoucherDate: 2002-08-19 19:56:12
Subject: FreeBSD -pthread -lpq problem...
Previous:From: Warren W. Gay VE3WWGDate: 2002-08-17 16:20:15
Subject: Re: libpq bug handling signals

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group