public class TransactionContextHelper
extends java.lang.Object
| Constructor and Description |
|---|
TransactionContextHelper() |
| Modifier and Type | Method and Description |
|---|---|
static BitronixTransaction |
currentTransaction()
Get the transaction running on the current thead context.
|
static void |
delistFromCurrentTransaction(XAResourceHolder xaResourceHolder)
Delist the
XAResourceHolder from the current transaction or do nothing if there is no global transaction
context for this thread. |
static void |
enlistInCurrentTransaction(XAResourceHolder xaResourceHolder)
Enlist the
XAResourceHolder in the current transaction or do nothing if there is no global transaction
context for this thread. |
static void |
recycle(XAStatefulHolder xaStatefulHolder)
Ensure the
XAStatefulHolder's release won't be deferred anymore (when appropriate) as it has been recycled. |
static void |
requeue(XAStatefulHolder xaStatefulHolder,
ResourceBean bean)
Switch the
XAStatefulHolder's state appropriately after the acquired resource handle has been closed. |
public static void enlistInCurrentTransaction(XAResourceHolder xaResourceHolder) throws javax.transaction.SystemException, javax.transaction.RollbackException
XAResourceHolder in the current transaction or do nothing if there is no global transaction
context for this thread.xaResourceHolder - the XAResourceHolder to enlist.javax.transaction.SystemException - if an internal error happens.javax.transaction.RollbackException - if the current transaction has been marked as rollback only.public static void delistFromCurrentTransaction(XAResourceHolder xaResourceHolder) throws javax.transaction.SystemException
XAResourceHolder from the current transaction or do nothing if there is no global transaction
context for this thread.xaResourceHolder - the XAResourceHolder to delist.javax.transaction.SystemException - if an internal error happens.public static BitronixTransaction currentTransaction()
public static void requeue(XAStatefulHolder xaStatefulHolder, ResourceBean bean) throws BitronixSystemException
XAStatefulHolder's state appropriately after the acquired resource handle has been closed.
The pooled resource will either be marked as closed or not accessible, depending on the value of the bean's
deferConnectionRelease property and will be marked for release after 2PC execution in the latter case.xaStatefulHolder - the XAStatefulHolder to requeue.bean - the ResourceBean of the XAResourceHolder.BitronixSystemException - if an internal error happens.public static void recycle(XAStatefulHolder xaStatefulHolder)
XAStatefulHolder's release won't be deferred anymore (when appropriate) as it has been recycled.xaStatefulHolder - the recycled XAStatefulHolder.Copyright © 2006-2023 Bitronix Software. All Rights Reserved.