pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Jowett <oliver@opencloud.com>
To: Warren Little <wlittle@securitylending.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: idle in transaction
Date: Mon, 16 Feb 2004 09:32:42 +1300
Message-ID: <402FD76A.2050403@opencloud.com> (raw)
In-Reply-To: <1076866428.3148.14.camel@localhost.localdomain>
References: <1076866428.3148.14.camel@localhost.localdomain>

Warren Little wrote:
> I recently posted this on pgsql-admin and was directed to try this list
> as well.
> 
> We recently upgraded postgres from 7.3 to 7.4, along with the JDBC jar,
> and noticed all the backend processes/connections are left in the "idle
> in transaction" state where before they where left in the "idle" state.
> Has something changed in the 7.4 jdbc driver vs 7.3 which might be
> causing this?
> Note
> We call setAutoCommit(FALSE) on every connection when created.

The driver does a "commit; begin" when commit() is called. In an ideal 
world it'd delay the 'begin' until the first statement is executed (and 
batch execution with that statement to avoid an extra roundtrip) but 
currently it doesn't. There is a TODO comment to this effect in the driver.

This area has certainly changed since 7.3, most notably how server-side 
autocommit (not JDBC autocommit) is handled was changed. The 7.3 driver 
appears to have used 'set autocommit = off' with a 7.3 driver vs. a 7.3 
server, but it reverted to using commit;begin in all cases after 
server-side autocommit disappeared again in 7.4.

-O



view thread (21+ messages)  latest in thread

Message-ID: <402FD76A.2050403@opencloud.com>
Permalink:  ../402FD76A.2050403@opencloud.com/
Also on:    postgresql.org/message-id/402FD76A.2050403@opencloud.com

 · 

reply

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: oliver@opencloud.com, wlittle@securitylending.com
  Subject: Re: idle in transaction
  In-Reply-To: <402FD76A.2050403@opencloud.com>
  References: <1076866428.3148.14.camel@localhost.localdomain> <402FD76A.2050403@opencloud.com>

* 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