From: Craig Ringer <ringerc@ringerc.id.au>
To: Radosław Smogura <rsmogura@softperience.eu>
Cc: Amar Dhole <adhole@tibco.com>
Cc: 'pgsql-jdbc@postgresql.org' <pgsql-jdbc@postgresql.org>
Subject: Re: use of savepoint in containter managed transaction
Date: Sun, 25 Sep 2011 19:53:57 +0800
Message-ID: <4E7F1655.5030700@ringerc.id.au> (raw)
In-Reply-To: <56e0d51a0da22ca7628aa2469cdeee8c@mail.softperience.eu>
References: <B056671652AA4D418763981054BCEAB4092DCD@PA-MBX04.na.tibco.com>
<56e0d51a0da22ca7628aa2469cdeee8c@mail.softperience.eu>
On 23/09/2011 9:58 PM, Radosław Smogura wrote:
> I may suggest You, to try to manually use savepoints and rollbacks by
> explicite specifying such queryies
>
> createStatemnet().executeUpdate("SAVEPOINT ...")
> createStatemnet().executeUpdate(ROLLBACK TO SAVEPOINT....)
> createStatemnet().executeUpdate(RELEASE SAVEPOINT....)
> but do not use COMMIT, nor ROLLBACK, nor PREPARE TRANSACTION.
>
> You will need to put some work to arm your code in necessary try/catch.
>
> If this will work, and consequences of this I don't know (I suppose at
> 80-90% that this should not affect XA, it's really hard to tell at eye
> glance).
Alternately, tell your container you want a non-JTA-managed tansaction
so you don't need to worry about disturbing its view of the transaction
state. That's probably safer, since you want to manage your own
transactions so you don't really want JTA anyway.
--
Craig Ringer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: ringerc@ringerc.id.au, rsmogura@softperience.eu, adhole@tibco.com
Subject: Re: use of savepoint in containter managed transaction
In-Reply-To: <4E7F1655.5030700@ringerc.id.au>
References: <B056671652AA4D418763981054BCEAB4092DCD@PA-MBX04.na.tibco.com> <56e0d51a0da22ca7628aa2469cdeee8c@mail.softperience.eu> <4E7F1655.5030700@ringerc.id.au>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox