當前位置: 首頁>>代碼示例>>Java>>正文


Java TransactionDefinition.ISOLATION_READ_UNCOMMITTED屬性代碼示例

本文整理匯總了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;
	}
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:26,代碼來源:DefaultJdoDialect.java

示例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);
}
 
開發者ID:bendem,項目名稱:sql-streams-spring,代碼行數:9,代碼來源:SqlStreamsTransactionManager.java


注:本文中的org.springframework.transaction.TransactionDefinition.ISOLATION_READ_UNCOMMITTED屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。