Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 9E9A19FB458 for ; Mon, 23 Apr 2007 20:44:58 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 11795-09 for ; Mon, 23 Apr 2007 20:44:53 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [131.203.101.226]) by postgresql.org (Postfix) with ESMTP id 673539FA618 for ; Mon, 23 Apr 2007 20:44:53 -0300 (ADT) Received: from 222-154-134-238.jetstream.xtra.co.nz ([222.154.134.238] helo=[10.1.1.3]) by yass.opencloud.co.nz with asmtp (TLS-1.0:DHE_RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1Hg8DC-0002ye-17; Tue, 24 Apr 2007 11:44:50 +1200 Message-ID: <462D44EE.9020602@opencloud.com> Date: Tue, 24 Apr 2007 11:44:46 +1200 From: Oliver Jowett User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 To: Tom Lane CC: pgsql-jdbc@postgreSQL.org Subject: Re: JDBC feature request: auto savepoint per command References: <11539.1177352713@sss.pgh.pa.us> In-Reply-To: <11539.1177352713@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/91 X-Sequence-Number: 16940 Tom Lane wrote: > Some folk at JBoss (now part of Red Hat) are complaining to me that > there's no way to deal with failing statements within a transaction > in the context of CMT (Container Managed Transactions). The normal > advice would be to do SAVEPOINT and RELEASE around each statement, > but they say this is disallowed: > >> It's really a question of granularity. When using CMT a global >> transaction is not committed until the end of method completion. >> Prior to the JDBC connection being used, autocommit is set to false >> and the global transaction is officially started. When the global >> transaction completes, the transaction is committed as a whole. JDBC >> Rollback and commit within a managed transaction is prohibited as >> this is the responsibility of the container. So, setting a savepoint >> and rolling back (and subsequently committing) won't work in this >> context which is what the Postgres driver requires. They seem to be confusing rollback and commit of the managed transaction with use of savepoints.. I don't see why the prohibition on messing with the top-level global transaction affects use of savepoints, since use of savepoints won't affect that top-level transaction? -O