|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SavepointManager
Interface that specifies an API to programmatically manage transaction savepoints in a generic fashion. Extended by TransactionStatus to expose savepoint management functionality for a specific transaction.
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 from any specific persistence technology.
TransactionStatus
,
TransactionDefinition.PROPAGATION_NESTED
,
Savepoint
Method Summary | |
---|---|
Object |
createSavepoint()
Create a new savepoint. |
void |
releaseSavepoint(Object savepoint)
Explicitly release the given savepoint. |
void |
rollbackToSavepoint(Object savepoint)
Roll back to the given savepoint. |
Method Detail |
---|
Object createSavepoint() throws TransactionException
rollbackToSavepoint
, and explicitly release a
savepoint that you don't need anymore via releaseSavepoint
.
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 stateConnection.setSavepoint()
void rollbackToSavepoint(Object savepoint) throws TransactionException
savepoint
- the savepoint to roll back to
NestedTransactionNotSupportedException
- if the underlying
transaction does not support savepoints
TransactionException
- if the rollback failedConnection.rollback(java.sql.Savepoint)
void releaseSavepoint(Object savepoint) throws TransactionException
Note that most transaction managers will automatically release savepoints at transaction completion.
Implementations should fail as silently as possible if proper resource cleanup will still happen at transaction completion.
savepoint
- the savepoint to release
NestedTransactionNotSupportedException
- if the underlying
transaction does not support savepoints
TransactionException
- if the release failedConnection.releaseSavepoint(java.sql.Savepoint)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |