Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id BC33B2E2D4D for ; Wed, 5 Dec 2007 18:15:08 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 70463-05 for ; Wed, 5 Dec 2007 18:14:58 -0400 (AST) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.188]) by postgresql.org (Postfix) with ESMTP id EC8FC2E2D43 for ; Wed, 5 Dec 2007 18:14:57 -0400 (AST) Received: by nf-out-0910.google.com with SMTP id f5so2767986nfh for ; Wed, 05 Dec 2007 14:14:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:cc:in-reply-to:references:content-type:date:message-id:mime-version:x-mailer:content-transfer-encoding; bh=KujtnNFDYyQJ4iBMNXlzAG9HdmECSxqRURQua5geL3Y=; b=PRH6ADAzD2wboVZ04Nf2TDPicGdQqb92XlWROoeGRC3WXMhc0Oa7qbQqHG7Ct30G2gKX0zK07T2VMJq4fIoHtaskppRPoNGmjS7NwIdXio0yQ5vc7uoj03/YVC0n6pdNAeW/3JPNBZU5JvYOGtUkXM+HJaBf0mgNiS7Ei/Gy2JE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=received:subject:from:to:cc:in-reply-to:references:content-type:date:message-id:mime-version:x-mailer:content-transfer-encoding; b=IibQK+aiKqfTKMRqoT8EGGzOU5bp63kMRrgbdUTqKQvPoSdq4uMdwGaqx9gpj781S1Xu60wr3y2J1ERysREzgdyY23qFan3OHa20DJLgQndtTSKjpXzbVflLIlihkg7Ur5yyfBPtcu+D/PDMPgsq4ohA3yxo5ejEBm+0YyKY9f4= Received: by 10.78.179.12 with SMTP id b12mr982912huf.1196892895785; Wed, 05 Dec 2007 14:14:55 -0800 (PST) Received: from ?10.0.0.10? ( [83.180.65.201]) by mx.google.com with ESMTPS id g1sm32074muf.2007.12.05.14.14.53 (version=SSLv3 cipher=RC4-MD5); Wed, 05 Dec 2007 14:14:54 -0800 (PST) Subject: Re: Hibernate/JTA/PostgreSQL From: =?ISO-8859-1?Q?jo=EBl?= Winteregg To: Jimmy Wan Cc: pgsql-jdbc@postgresql.org In-Reply-To: <54D41E91F26CF6488C7088C89D9160F868BA94@21ctexg01.21technologies.com> References: <54D41E91F26CF6488C7088C89D9160F868BA88@21ctexg01.21technologies.com> <54D41E91F26CF6488C7088C89D9160F868BA94@21ctexg01.21technologies.com> Content-Type: text/plain; charset=ISO-8859-1 Date: Wed, 05 Dec 2007 23:14:52 +0100 Message-Id: <1196892892.5462.18.camel@hatman> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/30 X-Sequence-Number: 17885 Hello Jimmy, It's funny because I just had the same problem using Hibernate, Postgresql and BTM transaction manager during this week. I had many " state" which were locking my DB tables... As you can see (cf. pgsql-jdbc post below), the current Postgresql JDBC driver (XA implementation) contain a bug regarding transaction boundaries: http://archives.postgresql.org/pgsql-jdbc/2007-11/msg00051.php So maybe these strange transaction boundaries were letting transactions open (I also forgot to set a transaction timeout)... If you think it could be this kind of problem (i'm not a JTA expert), you can try this postgresql-jdbc patched version: http://archives.postgresql.org/pgsql-jdbc/2007-11/msg00054.php Or if as you said: "you don't really need to synchronize across multiple datasources", you can try (if your transaction manager allow this) the 1PC optimization which allow the use of a pure JDBC driver (no XAResource needs). For BTM transaction manager you will find informations here: http://docs.codehaus.org/display/BTM/LastResourceCommit And you can find great explanation about 1PC optimization here: http://jroller.com/pyrasun/category/XA For me, this work around worked perfectly ! I hope its help ! Joël On Wed, 2007-12-05 at 14:46 -0600, Jimmy Wan wrote: > Hello, I've been trying to simultaneously debug an issue with > connections > being left in the state. My software stack looks > something like this: > > Custom J2EE Code & Jackrabbit JCR > Hibernate 3.2.0 > Tranql 1.4.1/Tranql Connectors 1.4 > Geronimo 2.0.2 > PostgreSQL JDBC 8.2-504, 8.2-506, 8.2-507 > (been upgrading to no avail) > PostgreSQL on the backend (8.2.4 on Windows or 8.2.3 on Linux) > > I've also got a unit test environment that looks something like this: > Custom J2EE Code & Jackrabbit JCR > Hibernate 3.2.0 > Tranql 1.4.1/Tranql Connectors 1.4 > Embedded OpenEJB 1.0 > PostgreSQL JDBC 8.2-504, 8.2-506, 8.2-507 > (been upgrading to try and fix my problems to no avail) > PostgreSQL 8.2 on the backend. > > I saw the following note to the postgresql-jdbc list: > http://archives.postgresql.org/pgsql-jdbc/2006-10/msg00060.php > > Ludovic, I was wondering if your analysis for PostgreSQL evaluation > for compatibility with BTM was complete. Also, I was wondering > whether you could elaborate on the following statement about > Hibernate and JTA: > > In particular, the following passage: > "I'm not 100% sure about this but the fact that you cannot mix local > and global transactions will prevent Hibernate applications to work > when built with JTA. There are many cases where these features that > look not that important at first are quite critical." > > I had been under the assumption (misunderstanding?) that using the > JTASessionContext for Hibernate would force it to employ XA > transactions, but when stepping through the Hibernate code, I saw > that none of my Hibernate operations resulted in the enlistment of > XA resources. > > I'm about to throw in the towel wrt using XA (we don't really need > to synchronize across multiple datasources). > > I still consider myself an XA novice, so any pointers are helpful. > > ---------------------------(end of broadcast)--------------------------- > TIP 9: In versions below 8.0, the planner will ignore your desire to > choose an index scan if your joining column's datatypes do not > match