public class TransactionContext extends Object
InternalXAResource.prepare(org.apache.jackrabbit.data.core.TransactionContext) method, are eventually
 unlocked.| Constructor and Description | 
|---|
TransactionContext(Xid xid,
                  InternalXAResource[] resources)
Create a new instance of this class. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
commit()
Commit the transaction identified by this context. 
 | 
Object | 
getAttribute(String name)
Return an attribute value on this transaction. 
 | 
static Object | 
getCurrentThreadId()
Returns the current thread identifier. 
 | 
static boolean | 
isSameThreadId(Object a,
              Object b)
Compares the given thread identifiers for equality. 
 | 
boolean | 
isSuspended()
Return a flag indicating whether the association is suspended. 
 | 
void | 
prepare()
Prepare the transaction identified by this context. 
 | 
void | 
removeAttribute(String name)
Remove an attribute on this transaction. 
 | 
void | 
rollback()
Rollback the transaction identified by this context. 
 | 
void | 
setAttribute(String name,
            Object value)
Set an attribute on this transaction. 
 | 
void | 
setSuspended(boolean suspended)
Set a flag indicating whether the association is suspended. 
 | 
public TransactionContext(Xid xid, InternalXAResource[] resources)
xid - associated xidresources - transactional resourcespublic void setAttribute(String name, Object value)
null, it is semantically equivalent to
 removeAttribute(java.lang.String).name - attribute namevalue - attribute valuepublic Object getAttribute(String name)
name - attribute namenull if no attribute with that
         name existspublic void removeAttribute(String name)
name - attribute namepublic void prepare()
             throws XAException
XAException - if an error occurspublic void commit()
            throws XAException
XAException - if an error occurspublic void rollback()
              throws XAException
XAException - if an error occurspublic boolean isSuspended()
true if the association is suspended;
         false otherwisepublic void setSuspended(boolean suspended)
suspended - flag whether that the association is suspended.public static Object getCurrentThreadId()
XidWrapper, when running under a transaction.public static boolean isSameThreadId(Object a, Object b)
getCurrentThreadId()Copyright © 2004-2020 The Apache Software Foundation. All Rights Reserved.