|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbitronix.tm.resource.common.TransactionContextHelper
public class TransactionContextHelper
Helper class that contains static logic common accross all resource types.
Constructor Summary | |
---|---|
TransactionContextHelper()
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TransactionContextHelper()
Method Detail |
---|
public static void enlistInCurrentTransaction(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 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 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
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |