2.4. The Transaction Interface
The
Transaction
interface allows operations to be performed on the transaction associated with the target object. Every top-level transaction is associated with one Transaction
object when the transaction is created. The Transaction
object can be used to:
- Enlist the transactional resources in use by the application.
- Register for transaction synchronization call backs.
- Commit or rollback the transaction.
- Obtain the status of the transaction.
The
commit
and rollback
methods allow the target object to be committed or rolled back. The calling thread is not required 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. JBossJTA does not impose restrictions on threads terminating transactions.