public static interface Transactions.Transaction
commits
or rollsback
the transaction as normal when it's work is done.Modifier and Type | Method and Description |
---|---|
void |
commit()
Commit the transaction currently associated with the calling thread.
|
String |
id()
Returns a unique identifier for the transaction.
|
void |
rollback()
Rolls back the transaction currently associated with the calling thread.
|
int |
status()
Returns the status associated with the current transaction
|
void |
uponCommit(Transactions.TransactionFunction function)
Register a function that will be called after the current transaction has been committed successfully, or immediately if there is not
currently an active transaction.
|
void |
uponCompletion(Transactions.TransactionFunction function)
Register a function that will be called when the current transaction completes.
|
String id()
null
int status() throws SystemException
int
code representing a transaction status.SystemException
- - If the transaction service fails in an unexpected way.Status
void uponCompletion(Transactions.TransactionFunction function)
function
- the completion functionvoid uponCommit(Transactions.TransactionFunction function)
function
- the completion functionvoid commit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, IllegalStateException, SystemException
RollbackException
- If the transaction was marked for rollback only, the transaction is rolled back and this
exception is thrown.IllegalStateException
- If the calling thread is not associated with a transaction.SystemException
- If the transaction service fails in an unexpected way.HeuristicMixedException
- If a heuristic decision was made and some some parts of the transaction have been
committed while other parts have been rolled back.HeuristicRollbackException
- If a heuristic decision to roll back the transaction was made.SecurityException
- If the caller is not allowed to commit this transaction.void rollback() throws IllegalStateException, SecurityException, SystemException
IllegalStateException
- If the transaction is in a state where it cannot be rolled back. This could be because
the calling thread is not associated with a transaction, or because it is in the prepared state
.SecurityException
- If the caller is not allowed to roll back this transaction.SystemException
- If the transaction service fails in an unexpected way.Copyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.