From: Kris Jurka <books@ejurka.com>
To: Temp02 <temp02@bluereef.com.au>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Can't throw the dreaded 'idle in transaction' - need
Date: Mon, 22 Nov 2004 01:20:21 -0500 (EST)
Message-ID: <Pine.BSO.4.56.0411220052090.3486@leary.csoft.net> (raw)
In-Reply-To: <02fe01c4d054$b60a5fe0$2201010a@bluereef.local>
References: <02fe01c4d054$b60a5fe0$2201010a@bluereef.local>
On Mon, 22 Nov 2004, Temp02 wrote:
> 2. Is the idle in transaction a "normal" event for all update
> transactions? Should the database release the lock immediately after the
> commit, in all instances? Should we assume that when we see an 'idle in
> transaction' that some error event has occurred that we're not seeing,
> like a failed query etc, that's causing the connection to remain open?
Idle in transaction is a normal state for every transaction that is not
run in autocommit mode. When the first statement is run a transaction is
started. When this statement completes the connection is "idle in
transaction". It stays this way until the next statement is run, such
that the transaction is no longer idle, or the transaction is ended by
either a commit or rollback.
> 3. We've tried to reduce all large transactions and complex queries
> effectively to small transaction 'blocks' or simply leave auto.commit to
> true and issue only single line updates. But this hasn't helped.
Potential problems could be error handling code that bails out leaving
the connection and transaction still in the idle-in-transaction state.
Another problem in a multi-threaded multi-connection application is a
deadlock involving both database and application resources. A deadlock in
the database will be detected and broken, but the database doesn't know
anything about locking code in the application.
Kris Jurka
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: books@ejurka.com, temp02@bluereef.com.au
Subject: Re: Can't throw the dreaded 'idle in transaction' - need
In-Reply-To: <Pine.BSO.4.56.0411220052090.3486@leary.csoft.net>
References: <02fe01c4d054$b60a5fe0$2201010a@bluereef.local> <Pine.BSO.4.56.0411220052090.3486@leary.csoft.net>
* 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