From: Björn Lundin <bjorn.lundin@swipnet.se>
To: pgsql-interfaces@postgresql.org
Subject: Re: determining if there's a transaction in progress
Date: Mon, 19 Aug 2002 10:54:58 +0200
Message-ID: <ajqbnu$25ma$1@news.hub.org> (raw)
References: <3D5DD515.4070302@cogeco.ca>
Warren W. Gay VE3WWG wrote:
<cut>
> 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.
</cut>
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 http://home.swipnet.se/lundin/ada_95_tools.html
/Björn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: bjorn.lundin@swipnet.se
Subject: Re: determining if there's a transaction in progress
In-Reply-To: <ajqbnu$25ma$1@news.hub.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox