Re: use of savepoint in containter managed transaction

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема Re: use of savepoint in containter managed transaction
Дата
Msg-id 4E7F1655.5030700@ringerc.id.au
обсуждение исходный текст
Ответ на Re: use of savepoint in containter managed transaction  (Radosław Smogura <rsmogura@softperience.eu>)
Список pgsql-jdbc
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

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Mikko Tiihonen
Дата:
Сообщение: Patch for binary transfer of UUID type
Следующее
От: "Craig Golby"
Дата:
Сообщение: Re: JVM & JDBC Upgrade --- Help !!