TransactionDefinition interface,
offering bean-style configuration and sensible default values
(PROPAGATION_REQUIRED, ISOLATION_DEFAULT, TIMEOUT_DEFAULT, readOnly=false).
Base class for both TransactionTemplate and
org..
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final Map | isolationConstants
Map of constant names to constant values for the isolation constants
defined in |
| private int | |
| private String | |
| public static final String | PREFIX_ISOLATION
Prefix for the isolation constants defined in TransactionDefinition. |
| public static final String | PREFIX_PROPAGATION
Prefix for the propagation constants defined in TransactionDefinition. |
| public static final String | PREFIX_TIMEOUT
Prefix for transaction timeout values in description strings. |
| private int | |
| pack-priv static final Map | propagationConstants
Map of constant names to constant values for the propagation constants
defined in |
| public static final String | READ_ONLY_MARKER
Marker for read-only transactions in description strings. |
| private boolean | |
| private int |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | DefaultTransactionDefinition(int
one of the propagation constants in the
TransactionDefinition interface propagationBehavior)Create a new DefaultTransactionDefinition with the given propagation behavior. |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object
the reference object with which to compare. other)Overrides java. toString() results.
|
| protected final StringBuilder | |
| public final int | getIsolationLevel()
Overrides default org. |
| pack-priv static String | |
| public final String | getName()
Overrides default org. |
| public final int | getPropagationBehavior()
Overrides default org. |
| private static String | |
| public final int | getTimeout()
Overrides default org. |
| public int | |
| public final boolean | isReadOnly()
Overrides default org. |
| public final void | |
| public final void | setIsolationLevelName(String
name of the constant constantName)Set the isolation level by the name of the corresponding constant in
|
| public final void | |
| public final void | |
| public final void | setPropagationBehaviorName(String
name of the constant constantName)Set the propagation behavior by the name of the corresponding constant in
|
| public final void | |
| public final void | |
| public String | toString()
Overrides java. |
| isolationConstants | back to summary |
|---|---|
| pack-priv static final Map<String, Integer> isolationConstants Map of constant names to constant values for the isolation constants
defined in | |
| isolationLevel | back to summary |
|---|---|
| private int isolationLevel | |
| name | back to summary |
|---|---|
| private String name
| |
| PREFIX_ISOLATION | back to summary |
|---|---|
| public static final String PREFIX_ISOLATION Prefix for the isolation constants defined in TransactionDefinition. | |
| PREFIX_PROPAGATION | back to summary |
|---|---|
| public static final String PREFIX_PROPAGATION Prefix for the propagation constants defined in TransactionDefinition. | |
| PREFIX_TIMEOUT | back to summary |
|---|---|
| public static final String PREFIX_TIMEOUT Prefix for transaction timeout values in description strings. | |
| propagationBehavior | back to summary |
|---|---|
| private int propagationBehavior | |
| propagationConstants | back to summary |
|---|---|
| pack-priv static final Map<String, Integer> propagationConstants Map of constant names to constant values for the propagation constants
defined in | |
| READ_ONLY_MARKER | back to summary |
|---|---|
| public static final String READ_ONLY_MARKER Marker for read-only transactions in description strings. | |
| readOnly | back to summary |
|---|---|
| private boolean readOnly | |
| timeout | back to summary |
|---|---|
| private int timeout | |
| DefaultTransactionDefinition | back to summary |
|---|---|
| public DefaultTransactionDefinition() Create a new DefaultTransactionDefinition, with default settings. Can be modified through bean property setters.
| |
| DefaultTransactionDefinition | back to summary |
|---|---|
| public DefaultTransactionDefinition(TransactionDefinition other) Copy constructor. Definition can be modified through bean property setters.
| |
| DefaultTransactionDefinition | back to summary |
|---|---|
| public DefaultTransactionDefinition(int propagationBehavior) Create a new DefaultTransactionDefinition with the given propagation behavior. Can be modified through bean property setters.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Overrides java. This implementation compares the
| |
| getDefinitionDescription | back to summary |
|---|---|
| protected final StringBuilder getDefinitionDescription() Return an identifying description for this transaction definition. Available to subclasses, for inclusion in their | |
| getIsolationLevel | back to summary |
|---|---|
| public final int getIsolationLevel() Overrides default org. Doc from org. Return the isolation level. Must return one of the Exclusively designed for use with The default is
| |
| getIsolationLevelName | back to summary |
|---|---|
| pack-priv static String getIsolationLevelName(int isolationLevel) | |
| getName | back to summary |
|---|---|
| public final String getName() Overrides default org. Doc from org. Return the name of this transaction. Can be This will be used as the transaction name to be shown in a transaction monitor, if applicable. In case of Spring's declarative transactions, the exposed name will be
the | |
| getPropagationBehavior | back to summary |
|---|---|
| public final int getPropagationBehavior() Overrides default org. Doc from org. Return the propagation behavior. Must return one of the The default is
| |
| getPropagationBehaviorName | back to summary |
|---|---|
| private static String getPropagationBehaviorName(int propagationBehavior) | |
| getTimeout | back to summary |
|---|---|
| public final int getTimeout() Overrides default org. Doc from org. Return the transaction timeout. Must return a number of seconds, or Exclusively designed for use with Note that a transaction manager that does not support timeouts will throw
an exception when given any other timeout than The default is
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. This implementation returns
| |
| isReadOnly | back to summary |
|---|---|
| public final boolean isReadOnly() Overrides default org. Doc from org. Return whether to optimize as a read-only transaction. The read-only flag applies to any transaction context, whether backed
by an actual resource transaction ( This just serves as a hint for the actual transaction subsystem; it will not necessarily cause failure of write access attempts. A transaction manager which cannot interpret the read-only hint will not throw an exception when asked for a read-only transaction.
| |
| setIsolationLevel | back to summary |
|---|---|
| public final void setIsolationLevel(int isolationLevel) Set the isolation level. Must be one of the isolation constants in the TransactionDefinition interface. Default is ISOLATION_DEFAULT. Exclusively designed for use with Note that a transaction manager that does not support custom isolation levels
will throw an exception when given any other level than
| |
| setIsolationLevelName | back to summary |
|---|---|
| public final void setIsolationLevelName(String constantName) throws IllegalArgumentException Set the isolation level by the name of the corresponding constant in
| |
| setName | back to summary |
|---|---|
| public final void setName(String name) Set the name of this transaction. Default is none. This will be used as transaction name to be shown in a transaction monitor, if applicable (for example, WebLogic's). | |
| setPropagationBehavior | back to summary |
|---|---|
| public final void setPropagationBehavior(int propagationBehavior) Set the propagation behavior. Must be one of the propagation constants in the TransactionDefinition interface. Default is PROPAGATION_REQUIRED. Exclusively designed for use with Note that a transaction manager that does not support custom isolation levels
will throw an exception when given any other level than
| |
| setPropagationBehaviorName | back to summary |
|---|---|
| public final void setPropagationBehaviorName(String constantName) throws IllegalArgumentException Set the propagation behavior by the name of the corresponding constant in
| |
| setReadOnly | back to summary |
|---|---|
| public final void setReadOnly(boolean readOnly) Set whether to optimize as read-only transaction. Default is "false". The read-only flag applies to any transaction context, whether backed
by an actual resource transaction ( This just serves as a hint for the actual transaction subsystem; it will not necessarily cause failure of write access attempts. A transaction manager which cannot interpret the read-only hint will not throw an exception when asked for a read-only transaction. | |
| setTimeout | back to summary |
|---|---|
| public final void setTimeout(int timeout) Set the timeout to apply, as number of seconds. Default is TIMEOUT_DEFAULT (-1). Exclusively designed for use with Note that a transaction manager that does not support timeouts will throw
an exception when given any other timeout than
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Return an identifying description for this transaction definition. The format matches the one used by
Has to be overridden in subclasses for correct
| |