| org.springframework.transaction.TransactionDefinition
All known Subclasses: org.springframework.transaction.support.DefaultTransactionDefinition,
Field Summary | |
int | ISOLATION_DEFAULT Use the default isolation level of the underlying datastore. | int | ISOLATION_READ_COMMITTED Indicates that dirty reads are prevented; non-repeatable reads and
phantom reads can occur. | int | ISOLATION_READ_UNCOMMITTED Indicates that dirty reads, non-repeatable reads and phantom reads
can occur.
This level allows a row changed by one transaction to be read by
another transaction before any changes in that row have been committed
(a "dirty read"). | int | ISOLATION_REPEATABLE_READ Indicates that dirty reads and non-repeatable reads are prevented;
phantom reads can occur. | int | ISOLATION_SERIALIZABLE Indicates that dirty reads, non-repeatable reads and phantom reads
are prevented. | int | PROPAGATION_MANDATORY Support a current transaction; throw an exception if no current transaction
exists. | int | PROPAGATION_NESTED Execute within a nested transaction if a current transaction exists,
behave like
TransactionDefinition.PROPAGATION_REQUIRED else. | int | PROPAGATION_NEVER Do not support a current transaction; throw an exception if a current transaction
exists. | int | PROPAGATION_NOT_SUPPORTED Do not support a current transaction; rather always execute non-transactionally.
Analogous to the EJB transaction attribute of the same name.
NOTE: Actual transaction suspension will not work out-of-the-box
on all transaction managers. | int | PROPAGATION_REQUIRED Support a current transaction; create a new one if none exists. | int | PROPAGATION_REQUIRES_NEW Create a new transaction, suspending the current transaction if one exists.
Analogous to the EJB transaction attribute of the same name.
NOTE: Actual transaction suspension will not work out-of-the-box
on all transaction managers. | int | PROPAGATION_SUPPORTS Support a current transaction; execute non-transactionally if none exists.
Analogous to the EJB transaction attribute of the same name.
NOTE: For transaction managers with transaction synchronization,
PROPAGATION_SUPPORTS is slightly different from no transaction
at all, as it defines a transaction scope that synchronization might apply to.
As a consequence, the same resources (a JDBC Connection , a
Hibernate Session , etc) will be shared for the entire specified
scope. | int | TIMEOUT_DEFAULT Use the default timeout of the underlying transaction system,
or none if timeouts are not supported. |
ISOLATION_DEFAULT | int ISOLATION_DEFAULT(Code) | | Use the default isolation level of the underlying datastore.
All other levels correspond to the JDBC isolation levels.
See Also: java.sql.Connection |
ISOLATION_READ_COMMITTED | int ISOLATION_READ_COMMITTED(Code) | | Indicates that dirty reads are prevented; non-repeatable reads and
phantom reads can occur.
This level only prohibits a transaction from reading a row
with uncommitted changes in it.
See Also: java.sql.Connection.TRANSACTION_READ_COMMITTED |
ISOLATION_READ_UNCOMMITTED | int ISOLATION_READ_UNCOMMITTED(Code) | | Indicates that dirty reads, non-repeatable reads and phantom reads
can occur.
This level allows a row changed by one transaction to be read by
another transaction before any changes in that row have been committed
(a "dirty read"). If any of the changes are rolled back, the second
transaction will have retrieved an invalid row.
See Also: java.sql.Connection.TRANSACTION_READ_UNCOMMITTED |
ISOLATION_REPEATABLE_READ | int ISOLATION_REPEATABLE_READ(Code) | | Indicates that dirty reads and non-repeatable reads are prevented;
phantom reads can occur.
This level prohibits a transaction from reading a row with
uncommitted changes in it, and it also prohibits the situation
where one transaction reads a row, a second transaction alters
the row, and the first transaction rereads the row, getting
different values the second time (a "non-repeatable read").
See Also: java.sql.Connection.TRANSACTION_REPEATABLE_READ |
ISOLATION_SERIALIZABLE | int ISOLATION_SERIALIZABLE(Code) | | Indicates that dirty reads, non-repeatable reads and phantom reads
are prevented.
This level includes the prohibitions in
TransactionDefinition.ISOLATION_REPEATABLE_READ and further prohibits the
situation where one transaction reads all rows that satisfy a
WHERE condition, a second transaction inserts a
row that satisfies that WHERE condition, and the
first transaction rereads for the same condition, retrieving
the additional "phantom" row in the second read.
See Also: java.sql.Connection.TRANSACTION_SERIALIZABLE |
PROPAGATION_MANDATORY | int PROPAGATION_MANDATORY(Code) | | Support a current transaction; throw an exception if no current transaction
exists. Analogous to the EJB transaction attribute of the same name.
Note that transaction synchronization within a PROPAGATION_MANDATORY
scope will always be driven by the surrounding transaction.
|
PROPAGATION_NEVER | int PROPAGATION_NEVER(Code) | | Do not support a current transaction; throw an exception if a current transaction
exists. Analogous to the EJB transaction attribute of the same name.
Note that transaction synchronization is not available within a
PROPAGATION_NEVER scope.
|
PROPAGATION_NOT_SUPPORTED | int PROPAGATION_NOT_SUPPORTED(Code) | | Do not support a current transaction; rather always execute non-transactionally.
Analogous to the EJB transaction attribute of the same name.
NOTE: Actual transaction suspension will not work out-of-the-box
on all transaction managers. This in particular applies to
org.springframework.transaction.jta.JtaTransactionManager ,
which requires the javax.transaction.TransactionManager
to be made available it to it (which is server-specific in standard J2EE).
Note that transaction synchronization is not available within a
PROPAGATION_NOT_SUPPORTED scope. Existing synchronizations
will be suspended and resumed appropriately.
See Also: org.springframework.transaction.jta.JtaTransactionManager.setTransactionManager |
PROPAGATION_REQUIRED | int PROPAGATION_REQUIRED(Code) | | Support a current transaction; create a new one if none exists.
Analogous to the EJB transaction attribute of the same name.
This is typically the default setting of a transaction definition,
and typically defines a transaction synchronization scope.
|
PROPAGATION_REQUIRES_NEW | int PROPAGATION_REQUIRES_NEW(Code) | | Create a new transaction, suspending the current transaction if one exists.
Analogous to the EJB transaction attribute of the same name.
NOTE: Actual transaction suspension will not work out-of-the-box
on all transaction managers. This in particular applies to
org.springframework.transaction.jta.JtaTransactionManager ,
which requires the javax.transaction.TransactionManager
to be made available it to it (which is server-specific in standard J2EE).
A PROPAGATION_REQUIRES_NEW scope always defines its own
transaction synchronizations. Existing synchronizations will be suspended
and resumed appropriately.
See Also: org.springframework.transaction.jta.JtaTransactionManager.setTransactionManager |
PROPAGATION_SUPPORTS | int PROPAGATION_SUPPORTS(Code) | | Support a current transaction; execute non-transactionally if none exists.
Analogous to the EJB transaction attribute of the same name.
NOTE: For transaction managers with transaction synchronization,
PROPAGATION_SUPPORTS is slightly different from no transaction
at all, as it defines a transaction scope that synchronization might apply to.
As a consequence, the same resources (a JDBC Connection , a
Hibernate Session , etc) will be shared for the entire specified
scope. Note that the exact behavior depends on the actual synchronization
configuration of the transaction manager!
In general, use PROPAGATION_SUPPORTS with care! In particular, do
not rely on PROPAGATION_REQUIRED or PROPAGATION_REQUIRES_NEW
within a PROPAGATION_SUPPORTS scope (which may lead to
synchronization conflicts at runtime). If such nesting is unavoidable, make sure
to configure your transaction manager appropriately (typically switching to
"synchronization on actual transaction").
See Also: org.springframework.transaction.support.AbstractPlatformTransactionManager.setTransactionSynchronization See Also: org.springframework.transaction.support.AbstractPlatformTransactionManager.SYNCHRONIZATION_ON_ACTUAL_TRANSACTION |
TIMEOUT_DEFAULT | int TIMEOUT_DEFAULT(Code) | | Use the default timeout of the underlying transaction system,
or none if timeouts are not supported.
|
|
|