本文整理匯總了Java中org.springframework.transaction.TransactionDefinition.ISOLATION_READ_UNCOMMITTED屬性的典型用法代碼示例。如果您正苦於以下問題:Java TransactionDefinition.ISOLATION_READ_UNCOMMITTED屬性的具體用法?Java TransactionDefinition.ISOLATION_READ_UNCOMMITTED怎麽用?Java TransactionDefinition.ISOLATION_READ_UNCOMMITTED使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.springframework.transaction.TransactionDefinition
的用法示例。
在下文中一共展示了TransactionDefinition.ISOLATION_READ_UNCOMMITTED屬性的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getJdoIsolationLevel
/**
* Determine the JDO isolation level String to use for the given
* Spring transaction definition.
* @param definition the Spring transaction definition
* @return the corresponding JDO isolation level String, or {@code null}
* to indicate that no isolation level should be set explicitly
* @see Transaction#setIsolationLevel(String)
* @see Constants#TX_SERIALIZABLE
* @see Constants#TX_REPEATABLE_READ
* @see Constants#TX_READ_COMMITTED
* @see Constants#TX_READ_UNCOMMITTED
*/
protected String getJdoIsolationLevel(TransactionDefinition definition) {
switch (definition.getIsolationLevel()) {
case TransactionDefinition.ISOLATION_SERIALIZABLE:
return Constants.TX_SERIALIZABLE;
case TransactionDefinition.ISOLATION_REPEATABLE_READ:
return Constants.TX_REPEATABLE_READ;
case TransactionDefinition.ISOLATION_READ_COMMITTED:
return Constants.TX_READ_COMMITTED;
case TransactionDefinition.ISOLATION_READ_UNCOMMITTED:
return Constants.TX_READ_UNCOMMITTED;
default:
return null;
}
}
示例2: translateIsolationLevel
private static Transaction.IsolationLevel translateIsolationLevel(int isolationLevel) {
switch (isolationLevel) {
case TransactionDefinition.ISOLATION_READ_COMMITTED: return Transaction.IsolationLevel.READ_COMMITTED;
case TransactionDefinition.ISOLATION_READ_UNCOMMITTED: return Transaction.IsolationLevel.READ_UNCOMMITTED;
case TransactionDefinition.ISOLATION_REPEATABLE_READ: return Transaction.IsolationLevel.REPEATABLE_READ;
case TransactionDefinition.ISOLATION_SERIALIZABLE: return Transaction.IsolationLevel.SERIALIZABLE;
}
throw new IllegalArgumentException("invalid transaction isolation: " + isolationLevel);
}