Interface TransactionHandler
- All Known Implementing Classes:
TransactionHandlerImpl
public interface TransactionHandler
-
Method Summary
Modifier and TypeMethodDescriptionvoidbegin(int txTimeout) Begin the transactionbooleancanBegin()Can UserTransaction be started? Can start only if it doesn't already exist.voidcommit()Commit the transactionintjakarta.transaction.Status of the UserTransactionjakarta.transaction.Status as a String.booleanisActive()Is the UserTransaction active on this thread?booleanIs the UserTransaction marked for roll back?voidrollback()Roll back the transactionvoidMark the transaction as roll back onlybooleanIs transaction associated with the current thread?booleanIs the UserTransaction available?
-
Method Details
-
begin
Begin the transaction- Parameters:
txTimeout- Transaction timeout in seconds- Throws:
TransactionException
-
commit
Commit the transaction- Throws:
TransactionException
-
rollback
Roll back the transaction- Throws:
TransactionException
-
setRollbackOnly
Mark the transaction as roll back only- Throws:
TransactionException
-
userTransactionAvailable
Is the UserTransaction available?- Returns:
- true if UserTransaction can be looked up from JNDI, otherwise false
- Throws:
TransactionException
-
isActive
Is the UserTransaction active on this thread?- Returns:
- true if UserTransaction status is active
- Throws:
TransactionException
-
isMarkedForRollback
Is the UserTransaction marked for roll back?- Returns:
- true if UserTransaction is marked for roll back
- Throws:
TransactionException
-
canBegin
Can UserTransaction be started? Can start only if it doesn't already exist.- Returns:
- true if UserTransaction can be started
- Throws:
TransactionException
-
transactionExists
Is transaction associated with the current thread?- Returns:
- true if transaction is flowing on the current thread
- Throws:
TransactionException
-
getStatus
jakarta.transaction.Status of the UserTransaction- Returns:
- status integer of the UserTransaction
- Throws:
TransactionException
-
getStatusAsString
jakarta.transaction.Status as a String. Useful for logging.- Returns:
- status as a String
- Throws:
TransactionException
-