Re: JDBC feature request: auto savepoint per command

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-jdbc(at)postgreSQL(dot)org
Subject: Re: JDBC feature request: auto savepoint per command
Date: 2007-04-23 23:44:46
Message-ID: 462D44EE.9020602@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

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

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2007-04-23 23:46:43 Re: Can't build postgresql-jdbc-8.2-505 on Fedora 7
Previous Message Tom Lane 2007-04-23 23:12:13 Re: Can't build postgresql-jdbc-8.2-505 on Fedora 7