public interface TransactionManager
The implementation instance must be thread safe.
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasSavepoint(java.lang.String savepointName)
Whether the current transaction has the save point.
|
boolean |
isRollbackOnly()
Whether the current transaction is marked to be undone.
|
void |
notSupported(java.lang.Runnable block)
Executes the transaction whose attribute is NOT_SUPPORTED.
|
<RESULT> RESULT |
notSupported(java.util.function.Supplier<RESULT> supplier)
Executes the transaction whose attribute is NOT_SUPPORTED and returns the result.
|
void |
notSupported(TransactionIsolationLevel isolationLevel,
java.lang.Runnable block)
Executes the transaction whose attribute is NOT_SUPPORTED with the specified transaction
isolation level.
|
<RESULT> RESULT |
notSupported(TransactionIsolationLevel isolationLevel,
java.util.function.Supplier<RESULT> supplier)
Executes the transaction whose attribute is NOT_SUPPORTED with the specified transaction
isolation level and return the result.
|
void |
releaseSavepoint(java.lang.String savepointName)
Removes the specified save point and subsequent save points from the current transaction.
|
void |
required(java.lang.Runnable block)
Executes the transaction whose attribute is REQUIRED.
|
<RESULT> RESULT |
required(java.util.function.Supplier<RESULT> supplier)
Executes the transaction whose attribute is REQUIRED and returns the result.
|
void |
required(TransactionIsolationLevel isolationLevel,
java.lang.Runnable block)
Executes the transaction whose attribute is REQUIRED with the specified transaction isolation
level.
|
<RESULT> RESULT |
required(TransactionIsolationLevel isolationLevel,
java.util.function.Supplier<RESULT> supplier)
Executes the transaction whose attribute is REQUIRED with the specified transaction isolation
level and return the result.
|
void |
requiresNew(java.lang.Runnable block)
Executes the transaction whose attribute is REQUIRES_NEW.
|
<RESULT> RESULT |
requiresNew(java.util.function.Supplier<RESULT> supplier)
Executes the transaction whose attribute is REQUIRES_NEW and returns the result.
|
void |
requiresNew(TransactionIsolationLevel isolationLevel,
java.lang.Runnable block)
Executes the transaction whose attribute is REQUIRES_NEW with the specified transaction
isolation level.
|
<RESULT> RESULT |
requiresNew(TransactionIsolationLevel isolationLevel,
java.util.function.Supplier<RESULT> supplier)
Executes the transaction whose attribute is REQUIRES_NEW with the specified transaction
isolation level and return the result.
|
void |
rollback(java.lang.String savepointName)
Undoes all changes made after the given save point.
|
void |
setRollbackOnly()
Marks the current transaction to undo in the end of the transaction.
|
void |
setSavepoint(java.lang.String savepointName)
Creates a save point with the specified name.
|
void required(java.lang.Runnable block)
block - the code that is executed in the transactionvoid required(TransactionIsolationLevel isolationLevel, java.lang.Runnable block)
isolationLevel - the transaction isolation levelblock - the code that is executed in the transaction<RESULT> RESULT required(java.util.function.Supplier<RESULT> supplier)
RESULT - the result typesupplier - the code that is executed in the transaction<RESULT> RESULT required(TransactionIsolationLevel isolationLevel, java.util.function.Supplier<RESULT> supplier)
RESULT - the result typeisolationLevel - the transaction isolation levelsupplier - the code that is executed in the transactionvoid requiresNew(java.lang.Runnable block)
block - the code that is executed in the transactionvoid requiresNew(TransactionIsolationLevel isolationLevel, java.lang.Runnable block)
isolationLevel - the transaction isolation levelblock - the code that is executed in the transaction<RESULT> RESULT requiresNew(java.util.function.Supplier<RESULT> supplier)
RESULT - the result typesupplier - the code that is executed in the transaction<RESULT> RESULT requiresNew(TransactionIsolationLevel isolationLevel, java.util.function.Supplier<RESULT> supplier)
RESULT - the result typeisolationLevel - the transaction isolation levelsupplier - the code that is executed in the transactionvoid notSupported(java.lang.Runnable block)
block - the code that is executed in the transactionvoid notSupported(TransactionIsolationLevel isolationLevel, java.lang.Runnable block)
isolationLevel - the transaction isolation levelblock - the code that is executed in the transaction<RESULT> RESULT notSupported(java.util.function.Supplier<RESULT> supplier)
RESULT - the result typesupplier - the code that is executed in the transaction<RESULT> RESULT notSupported(TransactionIsolationLevel isolationLevel, java.util.function.Supplier<RESULT> supplier)
RESULT - the result typeisolationLevel - the transaction isolation levelsupplier - the code that is executed in the transactionvoid setRollbackOnly()
boolean isRollbackOnly()
true if the current transaction is marked.void setSavepoint(java.lang.String savepointName)
Begin a transaction before invoking this method.
savepointName - the name of the save pointDomaNullPointerException - if the savepointName is nullTransactionNotYetBegunException - if the transaction is not begunSavepointAlreadyExistsException - if the save point already existsJdbcException - if a JDBC related error occursboolean hasSavepoint(java.lang.String savepointName)
Begin a transaction before invoking this method.
savepointName - the name of the save pointtrue if the transaction has the save pointDomaNullPointerException - if the savepointName is nullTransactionNotYetBegunException - if the transaction is not begunvoid releaseSavepoint(java.lang.String savepointName)
Begin a transaction before invoking this method.
savepointName - the name of the save pointDomaNullPointerException - if the savepointName is nullTransactionNotYetBegunException - if the transaction is not yet begunJdbcException - if a JDBC related error occursvoid rollback(java.lang.String savepointName)
Begin a transaction before invoking this method.
savepointName - the name of the save pointDomaNullPointerException - if the savepointName is nullSavepointNotFoundException - if the save point is not foundTransactionNotYetBegunException - if the transaction is not begunJdbcException - if a JDBC related error occurs