public interface SavepointManager
Note that savepoints can only work within an active transaction. Just use this programmatic savepoint handling for advanced needs; else, a subtransaction with PROPAGATION_NESTED is preferable.
This interface is inspired by JDBC 3.0's Savepoint mechanism but is independent of any specific persistence technology.
|Modifier and Type
|Method and Description
Create a new savepoint.
Explicitly release the given savepoint.
Roll back to the given savepoint.
Object createSavepoint() throws TransactionException
rollbackToSavepoint, and explicitly release a savepoint
that you don't need anymore via
Note that most transaction managers will automatically release savepoints at transaction completion.
NestedTransactionNotSupportedException - if the underlying
transaction does not support savepoints
TransactionException - if the savepoint could not be created,
for example because the transaction is not in an appropriate state
void rollbackToSavepoint(Object savepoint) throws TransactionException
The savepoint will not be automatically released afterwards.
You may explicitly call
releaseSavepoint(Object) or rely on
automatic release on transaction completion.
void releaseSavepoint(Object savepoint) throws TransactionException
Note that most transaction managers will automatically release savepoints on transaction completion.
Implementations should fail as silently as possible if proper resource cleanup will eventually happen at transaction completion.