org.springframework.transaction.support |
Support classes for the org.springframework.transaction package.
Provides an abstract base class for transaction manager implementations,
and a template plus callback for transaction demarcation.
|
Java Source File Name | Type | Comment |
AbstractPlatformTransactionManager.java | Class | Abstract base class that implements Spring's standard transaction workflow,
serving as basis for concrete platform transaction managers like
org.springframework.transaction.jta.JtaTransactionManager and
org.springframework.jdbc.datasource.DataSourceTransactionManager .
This base class provides the following workflow handling:
- determines if there is an existing transaction;
- applies the appropriate propagation behavior;
- suspends and resumes transactions if necessary;
- checks the rollback-only flag on commit;
- applies the appropriate modification on rollback
(actual rollback or setting rollback-only);
- triggers registered synchronization callbacks
(if transaction synchronization is active).
Subclasses have to implement specific template methods for specific
states of a transaction, e.g.: begin, suspend, resume, commit, rollback.
The most important of them are abstract and must be provided by a concrete
implementation; for the rest, defaults are provided, so overriding is optional.
Transaction synchronization is a generic mechanism for registering callbacks
that get invoked at transaction completion time. |
AbstractTransactionStatus.java | Class | Abstract base implementation of the
org.springframework.transaction.TransactionStatus interface. |
CallbackPreferringPlatformTransactionManager.java | Interface | Extension of the
org.springframework.transaction.PlatformTransactionManager interface, exposing a method for executing a given callback within a transaction.
Implementors of this interface automatically express a preference for
callbacks over programmatic getTransaction , commit
and rollback calls. |
DefaultTransactionDefinition.java | Class | Default implementation of the TransactionDefinition interface,
offering bean-style configuration and sensible default values
(PROPAGATION_REQUIRED, ISOLATION_DEFAULT, TIMEOUT_DEFAULT, readOnly=false). |
DefaultTransactionStatus.java | Class | Default implementation of the
org.springframework.transaction.TransactionStatus interface, used by
AbstractPlatformTransactionManager . |
ResourceHolderSupport.java | Class | Convenient base class for resource holders. |
ResourceTransactionManager.java | Interface | Extension of the
org.springframework.transaction.PlatformTransactionManager interface, indicating a native resource transaction manager, operating on a single
target resource. |
SimpleTransactionStatus.java | Class | A simple
org.springframework.transaction.TransactionStatus implementation.
Derives from
AbstractTransactionStatus and adds an explicit
SimpleTransactionStatus.isNewTransaction() "newTransaction" flag.
This class is not used by any of Spring's pre-built
org.springframework.transaction.PlatformTransactionManager implementations. |
SmartTransactionObject.java | Interface | Interface to be implemented by transaction objects that are able to
return an internal rollback-only marker, typically from a another
transaction that has participated and marked it as rollback-only. |
TransactionCallback.java | Interface | Callback interface for transactional code. |
TransactionCallbackWithoutResult.java | Class | Simple convenience class for TransactionCallback implementation.
Allows for implementing a doInTransaction version without result,
i.e. |
TransactionOperations.java | Interface | Interface specifying basic transaction execution operations.
Implemented by
TransactionTemplate . |
TransactionSynchronization.java | Interface | Interface for transaction synchronization callbacks.
Supported by AbstractPlatformTransactionManager.
TransactionSynchronization implementations can implement the Ordered interface
to influence their execution order. |
TransactionSynchronizationAdapter.java | Class | Simple
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. |
TransactionSynchronizationManager.java | Class | Central helper that manages resources and transaction synchronizations per thread.
To be used by resource management code but not by typical application code.
Supports one resource per key without overwriting, that is, a resource needs
to be removed before a new one can be set for the same key.
Supports a list of transaction synchronizations if synchronization is active.
Resource management code should check for thread-bound resources, e.g. |
TransactionSynchronizationUtils.java | Class | Utility methods for triggering specific
TransactionSynchronization callback methods on all currently registered synchronizations. |
TransactionTemplate.java | Class | Template class that simplifies programmatic transaction demarcation and
transaction exception handling.
The central method is
TransactionTemplate.execute , supporting transactional code that
implements the
TransactionCallback interface. |