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's Savepoint mechanism but is independent of any specific persistence technology.
TransactionStatus, TransactionDefinition#PROPAGATION_NESTED, java.sql.Savepoint
| Modifier and Type | Method and Description |
|---|---|
| public Object | |
| public void | |
| public void |
| createSavepoint | back to summary |
|---|---|
| public Object createSavepoint() throws TransactionException Create a new savepoint. You can roll back to a specific savepoint
via Note that most transaction managers will automatically release savepoints at transaction completion.
| |
| releaseSavepoint | back to summary |
|---|---|
| public void releaseSavepoint(Object savepoint) throws TransactionException Explicitly release the given savepoint. 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.
| |
| rollbackToSavepoint | back to summary |
|---|---|
| public void rollbackToSavepoint(Object savepoint) throws TransactionException Roll back to the given savepoint. The savepoint will not be automatically released afterwards.
You may explicitly call
| |