Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 751C11810A00 for ; Fri, 2 Mar 2012 13:01:51 -0400 (AST) Received: from mahout.postgresql.org ([98.129.198.123]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1S3Vra-0005zr-EA for pgsql-bugs@postgresql.org; Fri, 02 Mar 2012 17:01:51 +0000 Received: from [204.145.124.246] (helo=wrigleys.postgresql.org) by mahout.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1S3VrN-0004qN-Nl for pgsql-bugs@postgresql.org; Fri, 02 Mar 2012 17:01:38 +0000 Received: from www-data by wrigleys.postgresql.org with local (Exim 4.72) (envelope-from ) id 1S3VrN-0002ZW-DY for pgsql-bugs@postgresql.org; Fri, 02 Mar 2012 17:01:37 +0000 Date: Fri, 02 Mar 2012 17:01:37 +0000 Message-Id: Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #6503: Idle in transaction while lazy loading in JSF render response To: pgsql-bugs@postgresql.org From: j.vreven@aca-it.be X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201203/14 X-Sequence-Number: 32575 The following bug has been logged on the website: Bug reference: 6503 Logged by: Jo Vreven Email address: j.vreven@aca-it.be PostgreSQL version: 9.0.0 Operating system: MAC OSX Description: = This bug was not in jdbc4 driver: 8.4-701 But is introduced in jdbc4 driver: 8.4-702 It is still present in 9.1-901 Context: * Tomcat 7 * JPA2 Hibernate * Atomikos * Spring * JTA transaction manager (using org.postgresql.xa.PGXADataSource) =3D=3D=3D If in the JSF lifecycle render-response an element is fetched by means of lazy loading (that was not fetched in invoke-application lifecycle) a transaction will be started but it remains idle in transaction for postgres. The JTA Transaction manager has no active transactions at that moment, so for JTA everything seems commit/rollback. The connection seems to be back in the connectionpool, since the transaction was used for only read operations no harm is done, and the connection becomes idle for postgres when the next thread invokes a commit on this connection. Workaround 1: Use version 8.4-701 or lower Workaround 2: JSF phaselistener to begin and rollback transaction before and after render-response.