X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 820D2D1DF33 for ; Sun, 15 Feb 2004 20:33:14 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 77548-05 for ; Sun, 15 Feb 2004 16:33:11 -0400 (AST) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 58FA5D1DF05 for ; Sun, 15 Feb 2004 16:33:09 -0400 (AST) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=opencloud.com) by yass.opencloud.co.nz with asmtp (Exim 3.35 #1 (Debian)) id 1AsSwf-0000fW-00; Mon, 16 Feb 2004 09:32:53 +1300 Message-ID: <402FD76A.2050403@opencloud.com> Date: Mon, 16 Feb 2004 09:32:42 +1300 From: Oliver Jowett User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Warren Little Cc: pgsql-jdbc@postgresql.org Subject: Re: idle in transaction References: <1076866428.3148.14.camel@localhost.localdomain> In-Reply-To: <1076866428.3148.14.camel@localhost.localdomain> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/167 X-Sequence-Number: 9453 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