public interface TransactionContext
| Modifier and Type | Method and Description |
|---|---|
boolean |
getRollbackOnly()
Is this transaction marked for rollback only
|
Object |
getScopedValue(Object key)
Get a value scoped to this transaction
|
Object |
getTransactionKey()
Get the key associated with the current transaction
|
TransactionStatus |
getTransactionStatus() |
boolean |
isReadOnly() |
void |
postCompletion(java.util.function.Consumer<TransactionStatus> job)
Register a callback that will be made after the decision to commit or
rollback
|
void |
preCompletion(Runnable job)
Register a callback that will be made before a call to commit or rollback
|
void |
putScopedValue(Object key,
Object value)
Associate a value with this transaction
|
void |
registerLocalResource(LocalResource resource)
Register an XA resource with the current transaction
|
void |
registerXAResource(XAResource resource,
String name)
Register an XA resource with the current transaction
|
void |
setRollbackOnly()
Mark this transaction for rollback
|
boolean |
supportsLocal() |
boolean |
supportsXA() |
Object getTransactionKey()
Object getScopedValue(Object key)
key - nullvoid putScopedValue(Object key, Object value)
key - value - boolean getRollbackOnly()
throws IllegalStateException
IllegalStateException - if no transaction is activevoid setRollbackOnly()
throws IllegalStateException
IllegalStateException - if no transaction is activeTransactionStatus getTransactionStatus()
void preCompletion(Runnable job) throws IllegalStateException
job - IllegalStateException - if no transaction is active or the
transaction has already passed beyond the
TransactionStatus.MARKED_ROLLBACK statevoid postCompletion(java.util.function.Consumer<TransactionStatus> job) throws IllegalStateException
job - IllegalStateException - if no transaction is activeboolean supportsXA()
boolean supportsLocal()
boolean isReadOnly()
void registerXAResource(XAResource resource, String name) throws IllegalStateException
resource - name - The resource name used for recovery, may be null
if this resource is not recoverable. If a name is passed then
a corresponding RecoverableXAResource must be registered
in the service registryIllegalStateException - if no transaction is active, or the current
transaction is not XA capablevoid registerLocalResource(LocalResource resource) throws IllegalStateException
resource - IllegalStateException - if no transaction is active, or the current
transaction is not XA capableCopyright © 2016 The Apache Software Foundation. All rights reserved.