Deprecated
as of 5.3, in favor of the default methods on the
TransactionSynchronization interface
TransactionSynchronization adapter containing empty
method implementations, for easier overriding of single methods.
Also implements the Ordered interface to enable the execution
order of synchronizations to be controlled declaratively. The default
order is Ordered#LOWEST_PRECEDENCE, indicating
late execution; return a lower value for earlier execution.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | afterCommit()
Overrides default org. |
| public void | afterCompletion(int
completion status according to the status)STATUS_* constantsOverrides default org. |
| public void | beforeCommit(boolean
whether the transaction is defined as read-only transaction readOnly)Overrides default org. |
| public void | beforeCompletion()
Overrides default org. |
| public void | flush()
Overrides default org. |
| public int | getOrder()
Overrides default org. Implements org. |
| public void | resume()
Overrides default org. |
| public void | suspend()
Overrides default org. |
| TransactionSynchronizationAdapter | back to summary |
|---|---|
| public TransactionSynchronizationAdapter() | |
| afterCommit | back to summary |
|---|---|
| public void afterCommit() Overrides default org. Doc from org. Invoked after transaction commit. Can perform further operations right after the main transaction has successfully committed. Can e.g. commit further operations that are supposed to follow on a successful commit of the main transaction, like confirmation messages or emails. Note The transaction will have been committed already, but the
transactional resources might still be active and accessible. As a consequence,
any data access code triggered at this point will still "participate" in the
original transaction, allowing to perform some cleanup (with no commit following
anymore!), unless it explicitly declares that it needs to run in a separate
transaction. Hence: Use
| |
| afterCompletion | back to summary |
|---|---|
| public void afterCompletion(int status) Overrides default org. Doc from org. Invoked after transaction commit/rollback. Can perform resource cleanup after transaction completion. Note The transaction will have been committed or rolled back already,
but the transactional resources might still be active and accessible. As a
consequence, any data access code triggered at this point will still "participate"
in the original transaction, allowing to perform some cleanup (with no commit
following anymore!), unless it explicitly declares that it needs to run in a
separate transaction. Hence: Use
| |
| beforeCommit | back to summary |
|---|---|
| public void beforeCommit(boolean readOnly) Overrides default org. Doc from org. Invoked before transaction commit (before "beforeCompletion"). Can e.g. flush transactional O/R Mapping sessions to the database. This callback does not mean that the transaction will actually be committed. A rollback decision can still occur after this method has been called. This callback is rather meant to perform work that's only relevant if a commit still has a chance to happen, such as flushing SQL statements to the database. Note that exceptions will get propagated to the commit caller and cause a rollback of the transaction.
| |
| beforeCompletion | back to summary |
|---|---|
| public void beforeCompletion() Overrides default org. Doc from org. Invoked before transaction commit/rollback. Can perform resource cleanup before transaction completion. This method will be invoked after
| |
| flush | back to summary |
|---|---|
| public void flush() Overrides default org. Doc from org. Flush the underlying session to the datastore, if applicable: for example, a Hibernate/JPA session.
| |
| getOrder | back to summary |
|---|---|
| public int getOrder() Overrides default org. Implements org. Doc from org. Return the execution order for this transaction synchronization. Default is
| |
| resume | back to summary |
|---|---|
| public void resume() Overrides default org. Doc from org. Resume this synchronization. Supposed to rebind resources to TransactionSynchronizationManager if managing any.
| |
| suspend | back to summary |
|---|---|
| public void suspend() Overrides default org. Doc from org. Suspend this synchronization. Supposed to unbind resources from TransactionSynchronizationManager if managing any.
| |