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


Java LockMode.READ_UNCOMMITTED屬性代碼示例

本文整理匯總了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));
}
 
開發者ID:loye168,項目名稱:tddl5,代碼行數:37,代碼來源:JE_Table.java

示例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));
}
 
開發者ID:beebeandwer,項目名稱:TDDL,代碼行數:38,代碼來源:JE_Table.java


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