本文整理匯總了Java中com.sleepycat.je.LockMode.READ_UNCOMMITTED屬性的典型用法代碼示例。如果您正苦於以下問題:Java LockMode.READ_UNCOMMITTED屬性的具體用法?Java LockMode.READ_UNCOMMITTED怎麽用?Java LockMode.READ_UNCOMMITTED使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類com.sleepycat.je.LockMode
的用法示例。
在下文中一共展示了LockMode.READ_UNCOMMITTED屬性的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getCursor
public ISchematicCursor getCursor(ITransaction txn, IndexMeta indexMeta, String isolation, String actualTableName)
throws TddlException {
Database db = getDatabase(actualTableName);
if (db == null) {
throw new IllegalArgumentException("table don't contains indexName:" + actualTableName);
}
CursorConfig cc = CursorConfig.DEFAULT;
LockMode lm = LockMode.DEFAULT;
if (txn != null) {
com.sleepycat.je.TransactionConfig _config = ((JE_Transaction) txn).config;
if (_config.getReadUncommitted()) {
cc = CursorConfig.READ_UNCOMMITTED;
lm = LockMode.READ_UNCOMMITTED;
} else if (_config.getReadCommitted()) {
cc = CursorConfig.READ_COMMITTED;
// lm = LockMode.READ_COMMITTED;
}
} else {
if (Isolation.READ_COMMITTED.equals(isolation)) {
cc = CursorConfig.READ_COMMITTED;
// lm = LockMode.READ_COMMITTED;//not support
} else if (Isolation.READ_UNCOMMITTED.equals(isolation)) {
cc = CursorConfig.READ_UNCOMMITTED;
lm = LockMode.READ_UNCOMMITTED;
} else if (Isolation.REPEATABLE_READ.equals(isolation)) {
// default
} else if (Isolation.SERIALIZABLE.equals(isolation)) {
// txn_config
}
}
JE_Cursor je_cursor = new JE_Cursor(indexMeta, db.openCursor(txn == null ? null : ((JE_Transaction) txn).txn,
cc), lm);
if (txn != null) {
((JE_Transaction) txn).addCursor(je_cursor);
}
return new SchematicCursor(je_cursor, je_cursor.getiCursorMeta(), ExecUtils.getOrderBy(indexMeta));
}
示例2: getCursor
public ISchematicCursor getCursor(ITransaction txn, IndexMeta indexMeta, String isolation, String actualTableName)
throws TddlException {
Database db = getDatabase(actualTableName);
if (db == null) {
throw new TddlException("table don't contains indexName:" + actualTableName);
}
CursorConfig cc = CursorConfig.DEFAULT;
LockMode lm = LockMode.DEFAULT;
if (txn != null) {
com.sleepycat.je.TransactionConfig _config = ((JE_Transaction) txn).config;
if (_config.getReadUncommitted()) {
cc = CursorConfig.READ_UNCOMMITTED;
lm = LockMode.READ_UNCOMMITTED;
} else if (_config.getReadCommitted()) {
cc = CursorConfig.READ_COMMITTED;
// lm = LockMode.READ_COMMITTED;
}
} else {
if (Isolation.READ_COMMITTED.equals(isolation)) {
cc = CursorConfig.READ_COMMITTED;
// lm = LockMode.READ_COMMITTED;//not support
} else if (Isolation.READ_UNCOMMITTED.equals(isolation)) {
cc = CursorConfig.READ_UNCOMMITTED;
lm = LockMode.READ_UNCOMMITTED;
} else if (Isolation.REPEATABLE_READ.equals(isolation)) {
// default
} else if (Isolation.SERIALIZABLE.equals(isolation)) {
// txn_config
}
}
JE_Cursor je_cursor = new JE_Cursor(indexMeta,
db.openCursor(txn == null ? null : ((JE_Transaction) txn).txn, cc), lm);
if (txn != null) {
((JE_Transaction) txn).addCursor(je_cursor);
}
return new SchematicCursor(je_cursor, je_cursor.getiCursorMeta(), ExecUtils.getOrderBy(indexMeta));
}