|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface that specifies means to programmatically manage transaction savepoints in a generic fashion.
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.
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 |
public 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.
TransactionException
- if the savepoint could not be created,
either because the backend does not support it or because the
transaction is not in an appropriate stateConnection.setSavepoint()
public void rollbackToSavepoint(Object savepoint) throws TransactionException
savepoint
- the savepoint to roll back to
TransactionException
- if the rollback failedConnection.rollback(java.sql.Savepoint)
public 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
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 |