Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 39E999FB5A0 for ; Mon, 23 Apr 2007 15:25:19 -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 87111-03 for ; Mon, 23 Apr 2007 15:25:15 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 2BE549FB606 for ; Mon, 23 Apr 2007 15:25:15 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id l3NIPDUU011540 for ; Mon, 23 Apr 2007 14:25:13 -0400 (EDT) To: pgsql-jdbc@postgreSQL.org Subject: JDBC feature request: auto savepoint per command Date: Mon, 23 Apr 2007 14:25:13 -0400 Message-ID: <11539.1177352713@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/86 X-Sequence-Number: 16935 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. Can anyone see a solution for this in the context of the existing driver facilities? If not, is it reasonable to ask for a driver option to do auto-savepointing? There is already an equivalent facility in psql, so the idea doesn't seem unreasonable to me. regards, tom lane