Product SiteDocumentation Site

2.6. The Transaction interface

The Transaction interface allows you to perform operations on the transaction associated with the target object. Every top-level transaction is associated with one Transaction object when the transaction is created.
Uses of the Transaction object
The commit and rollback methods allow the target object to be committed or rolled back. The calling thread does not need to have the same transaction associated with the thread. If the calling thread is not allowed to commit the transaction, the transaction manager throws an exception. At present JBoss Transactions does not impose restrictions on threads terminating transactions.
The JTA standard does not provide a means to obtain the transaction identifier. However, JBoss Transactions provides several ways to view the transaction identifier. Call method toString to print full information about the transaction, including the identifier. Alternatively you can cast the javax.transaction.Transaction instance to a com.arjuna.ats.jta.transaction.Transaction , then call either method get_uid , which returns an ArjunaCore Uid representation, or getTxId , which returns an Xid for the global identifier, i.e., no branch qualifier.