Return-Path: Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: (qmail 52185 invoked from network); 24 Apr 2007 14:17:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 24 Apr 2007 14:17:38 -0000 Received: (qmail 8879 invoked by uid 500); 24 Apr 2007 14:17:44 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 8868 invoked by uid 500); 24 Apr 2007 14:17:44 -0000 Mailing-List: contact user-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cayenne.apache.org Delivered-To: mailing list user@cayenne.apache.org Received: (qmail 8859 invoked by uid 99); 24 Apr 2007 14:17:44 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Apr 2007 07:17:44 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [207.210.96.236] (HELO byaroza.objectstyle.org) (207.210.96.236) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 24 Apr 2007 07:17:35 -0700 Received: (qmail 16000 invoked from network); 24 Apr 2007 14:17:14 -0000 Received: from unknown (HELO ?JB?????IPv6:::1?) (127.0.0.1) by localhost with SMTP; 24 Apr 2007 14:17:14 -0000 Mime-Version: 1.0 (Apple Message framework v752.3) In-Reply-To: References: Content-Type: text/plain; charset=ISO-8859-1; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: quoted-printable From: Andrus Adamchik Subject: Re: AW: postgres, idle in transaction Date: Tue, 24 Apr 2007 17:17:12 +0300 To: user@cayenne.apache.org X-Mailer: Apple Mail (2.752.3) X-Virus-Checked: Checked by ClamAV on apache.org Interesting... Looking at your log I see this: 15:33:08.267 (2) FE=3D> Parse(stmt=3DS_1,query=3D"BEGIN",oids=3D{}) ..... 15:33:08.268 (2) FE=3D> Parse(stmt=3Dnull,query=3D"SELECT .... .... 15:33:28.461 (2) FE=3D> Parse(stmt=3DS_2,query=3D"COMMIT",oids=3D{}) So transaction is clearly committed. But of course connection is not =20 closed. It is returned to the pool instead. Still looks like a driver =20= bug to me. Andrus On Apr 24, 2007, at 5:03 PM, Oilid Adsi wrote: > Hi again, > >> -----Urspr=FCngliche Nachricht----- >> Von: Andrus Adamchik [mailto:andrus@objectstyle.org] >> Gesendet: Dienstag, 24. April 2007 12:23 >> An: user@cayenne.apache.org >> Betreff: Re: postgres, idle in transaction >> >> >> On Apr 24, 2007, at 12:58 PM, Oilid Adsi wrote: >> >>> Normally I thought we can do the workaround with committing every >>> query (method commitChanges in the DataContext) or setting the JDBC- >>> parameter defaultAutoCommit=3D"true". But both of these workarounds >>> didn't work properly. >> >> I am sure they did not. I was surprised when Peter reported that >> 'commitChanges' worked as a workaround. This shouldn't make any >> difference. >> >>> Postgres-JDBC-driver 8.2-504.jdbc3 >> >> Worth checking a different version as well (I've see strangest cross- >> version issues with the driver in the past). >> > > The postgres mailinglist is sure that this problem/bug was fixed =20 > (see attachment). I also switched to the newest jdbc-version: =20 > PostgreSQL 8.3devel JDBC3 with SSL (build 600). > << Re JDBC idle in transaction problem.txt >> > >> >>>> Also could you possibly switch the DataSource to DBCP [2] and =20 >>>> see if >>>> that DBCP DataSource does the right thing? >>> We will do this switch and give feedback. >> >> Please do. This will be an indication of whether we need to fix our >> connection pool or not. >> > > Same behaviour and still the same problem with DBCP DataSource ;-( > Sometimes the transaction will be committed sometimes not: > << postgres_debug_transaction.txt >> > >> >>> Why cayenne uses a transaction (BEGIN - COMMIT) for performing a >>> select-query? Is this the useful way as described on this link: >>> http://www.ashtech.net/~syntax/blog/archives/56-Hibernate-and- >>> PostgreSQL-Require-Transactions.html >> >> Main reason is consistency. There can be select queries that are not >> just select (e.g. stored procedure queries that both select and >> update). So Cayenne handles all queries the same way, instead of >> trying to analyze each query coming down the pipe. >> >> Andrus >> > > >