public final class TransactionContextHelper extends Object
| Modifier and Type | Method and Description |
|---|---|
static BitronixTransaction |
currentTransaction()
Get the transaction running on the current thead context.
|
static void |
delistFromCurrentTransaction(XAResourceHolder<? extends 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<? extends 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<? extends XAStatefulHolder> xaStatefulHolder)
Ensure the
XAStatefulHolder's release won't be deferred anymore (when appropriate) as it has been recycled. |
static void |
requeue(XAStatefulHolder<? extends XAStatefulHolder> xaStatefulHolder,
ResourceBean bean)
Switch the
XAStatefulHolder's state appropriately after the acquired resource handle has been closed. |
public static void enlistInCurrentTransaction(XAResourceHolder<? extends XAResourceHolder> xaResourceHolder) throws SystemException, RollbackException
XAResourceHolder in the current transaction or do nothing if there is no global transaction
context for this thread.xaResourceHolder - the XAResourceHolder to enlist.SystemException - if an internal error happens.RollbackException - if the current transaction has been marked as rollback only.public static void delistFromCurrentTransaction(XAResourceHolder<? extends XAResourceHolder> xaResourceHolder) throws SystemException
XAResourceHolder from the current transaction or do nothing if there is no global transaction
context for this thread.xaResourceHolder - the XAResourceHolder to delist.SystemException - if an internal error happens.public static BitronixTransaction currentTransaction()
public static void requeue(XAStatefulHolder<? extends 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<? extends XAStatefulHolder> xaStatefulHolder)
XAStatefulHolder's release won't be deferred anymore (when appropriate) as it has been recycled.xaStatefulHolder - the recycled XAStatefulHolder.Copyright © 2006-2016 Bitronix Software. All Rights Reserved.