类 DefaultTransactionDefine
- 所有已实现的接口:
TransactionDefine
-
嵌套类概要
从接口继承的嵌套类/接口 org.anyline.data.transaction.TransactionDefine
TransactionDefine.MODE -
字段概要
字段修饰符和类型字段说明static final StringPrefix for the isolation constants defined in TransactionDefinition.static final StringPrefix for the propagation constants defined in TransactionDefinition.static final StringPrefix for transaction timeout values in description strings.static final StringMarker for read-only transactions in description strings.从接口继承的字段 org.anyline.data.transaction.TransactionDefine
ISOLATION_DEFAULT, ISOLATION_READ_COMMITTED, ISOLATION_READ_UNCOMMITTED, ISOLATION_REPEATABLE_READ, ISOLATION_SERIALIZABLE, PROPAGATION_MANDATORY, PROPAGATION_NESTED, PROPAGATION_NEVER, PROPAGATION_NOT_SUPPORTED, PROPAGATION_REQUIRED, PROPAGATION_REQUIRES_NEW, PROPAGATION_SUPPORTS, TIMEOUT_DEFAULT -
构造器概要
构造器构造器说明Create a new DefaultTransactionDefinition, with default settings.DefaultTransactionDefine(int propagationBehavior) Create a new DefaultTransactionDefinition with the given propagation behavior.Copy constructor. -
方法概要
修饰符和类型方法说明final intReturn the isolation level.getMode()getName()Return the name of this transaction.final intReturn the propagation behavior.final intReturn the transaction timeout.final booleanReturn whether to optimize as a read-only transaction.voidvoidSet the name of this transaction.voidsetReadOnly(boolean readOnly) Set whether to optimize as read-only transaction.voidsetTimeout(int timeout) Set the timeout to apply, as number of seconds.
-
字段详细资料
-
PREFIX_PROPAGATION
Prefix for the propagation constants defined in TransactionDefinition.- 另请参阅:
-
PREFIX_ISOLATION
Prefix for the isolation constants defined in TransactionDefinition.- 另请参阅:
-
PREFIX_TIMEOUT
Prefix for transaction timeout values in description strings.- 另请参阅:
-
READ_ONLY_MARKER
Marker for read-only transactions in description strings.- 另请参阅:
-
-
构造器详细资料
-
DefaultTransactionDefine
public DefaultTransactionDefine()Create a new DefaultTransactionDefinition, with default settings. Can be modified through bean property setters. -
DefaultTransactionDefine
Copy constructor. Definition can be modified through bean property setters. -
DefaultTransactionDefine
public DefaultTransactionDefine(int propagationBehavior) Create a new DefaultTransactionDefinition with the given propagation behavior. Can be modified through bean property setters.- 参数:
propagationBehavior- one of the propagation constants in the TransactionDefinition interface
-
-
方法详细资料
-
getPropagationBehavior
public final int getPropagationBehavior()从接口复制的说明:TransactionDefineReturn the propagation behavior.Must return one of the
PROPAGATION_XXXconstantsThe default is
TransactionDefine.PROPAGATION_REQUIRED.- 指定者:
getPropagationBehavior在接口中TransactionDefine- 返回:
- the propagation behavior
- 另请参阅:
-
getPropagationBehaviorName
- 指定者:
getPropagationBehaviorName在接口中TransactionDefine
-
getIsolationLevel
public final int getIsolationLevel()从接口复制的说明:TransactionDefineReturn the isolation level.Must return one of the
ISOLATION_XXXconstants defined onExclusively designed for use with
TransactionDefine.PROPAGATION_REQUIREDor transactions. Consider switching the "validateExistingTransactions" flag to "true" on your transaction manager if you'd like isolation level declarations to get rejected when participating in an existing transaction with a different isolation level.The default is
TransactionDefine.ISOLATION_DEFAULT. Note that a transaction manager that does not support custom isolation levels will throw an exception when given any other level thanTransactionDefine.ISOLATION_DEFAULT.- 指定者:
getIsolationLevel在接口中TransactionDefine- 返回:
- the isolation level
-
setTimeout
public void setTimeout(int timeout) Set the timeout to apply, as number of seconds. Default is TIMEOUT_DEFAULT (-1).Exclusively designed for use with
TransactionDefine.PROPAGATION_REQUIREDorTransactionDefine.PROPAGATION_REQUIRES_NEWsince it only applies to newly started transactions.Note that a transaction manager that does not support timeouts will throw an exception when given any other timeout than
TransactionDefine.TIMEOUT_DEFAULT.- 指定者:
setTimeout在接口中TransactionDefine- 另请参阅:
-
getTimeout
public final int getTimeout()从接口复制的说明:TransactionDefineReturn the transaction timeout.Must return a number of seconds, or
TransactionDefine.TIMEOUT_DEFAULT.Exclusively designed for use with
TransactionDefine.PROPAGATION_REQUIREDorTransactionDefine.PROPAGATION_REQUIRES_NEWsince it only applies to newly started transactions.Note that a transaction manager that does not support timeouts will throw an exception when given any other timeout than
TransactionDefine.TIMEOUT_DEFAULT.The default is
TransactionDefine.TIMEOUT_DEFAULT.- 指定者:
getTimeout在接口中TransactionDefine- 返回:
- the transaction timeout
-
setReadOnly
public 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 (
TransactionDefine.PROPAGATION_REQUIRED/TransactionDefine.PROPAGATION_REQUIRES_NEW) or operating non-transactionally at the resource level (TransactionDefine.PROPAGATION_SUPPORTS). In the latter case, the flag will only apply to managed resources within the application, such as a HibernateSession.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.
- 指定者:
setReadOnly在接口中TransactionDefine
-
isReadOnly
public final boolean isReadOnly()从接口复制的说明:TransactionDefineReturn whether to optimize as a read-only transaction.The read-only flag applies to any transaction context, whether backed by an actual resource transaction (
TransactionDefine.PROPAGATION_REQUIRED/TransactionDefine.PROPAGATION_REQUIRES_NEW) or operating non-transactionally at the resource level (TransactionDefine.PROPAGATION_SUPPORTS). In the latter case, the flag will only apply to managed resources within the application, such as a HibernateSession.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.
- 指定者:
isReadOnly在接口中TransactionDefine- 返回:
trueif the transaction is to be optimized as read-only (falseby default)
-
setName
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).
- 指定者:
setName在接口中TransactionDefine
-
getName
从接口复制的说明:TransactionDefineReturn the name of this transaction. Can benull.This will be used as the transaction name to be shown in a transaction monitor, if applicable (for example, WebLogic's).
In case of Spring's declarative transactions, the exposed name will be the
fully-qualified class name + "." + method name(by default).- 指定者:
getName在接口中TransactionDefine- 返回:
- the name of this transaction (
nullby default}
-
getMode
- 指定者:
getMode在接口中TransactionDefine
-
setMode
- 指定者:
setMode在接口中TransactionDefine
-