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


Java LockMode.DEFAULT屬性代碼示例

本文整理匯總了Java中com.sleepycat.je.LockMode.DEFAULT屬性的典型用法代碼示例。如果您正苦於以下問題:Java LockMode.DEFAULT屬性的具體用法?Java LockMode.DEFAULT怎麽用?Java LockMode.DEFAULT使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在com.sleepycat.je.LockMode的用法示例。


在下文中一共展示了LockMode.DEFAULT屬性的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: skip

/**
 * 
 */
private Pair<DBEntry, DBEntry> skip(char which, long maxCount, LockMode lockMode) {
    long skipped = 0;
    DBEntry key = new DBEntry(catalog);
    DBEntry data = new DBEntry(catalog);
    lockMode = null == lockMode ? LockMode.DEFAULT : lockMode;
    
    switch (which) {
        case 'n': skipped = delegate.skipNext(maxCount, key, data, lockMode); break;
        case 'p': skipped = delegate.skipPrev(maxCount, key, data, lockMode); break;
    }
    
    if (skipped <= 0) {
        return null;
    }
    
    return Pair.of(key, data);
}
 
開發者ID:jronrun,項目名稱:benayn,代碼行數:20,代碼來源:Berkeley.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 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

示例3: 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

示例4: get

/**
 * 
 */
private Pair<DBEntry, DBEntry> get(char which, LockMode lockMode) {
    OperationStatus status = null;
    DBEntry key = new DBEntry(catalog);
    DBEntry data = new DBEntry(catalog);
    lockMode = null == lockMode ? LockMode.DEFAULT : lockMode;
    
    switch (which) {
        case 'c':   //getCurrent
            status = delegate.getCurrent(key, data, lockMode);
            break;
        case 'f':   //getFirst
            status = delegate.getFirst(key, data, lockMode);
            break;
        case 'l':   //getLast
            status = delegate.getLast(key, data, lockMode);
            break;
        case 'n':   //getNext
            status = delegate.getNext(key, data, lockMode);
            break; 
        case 'N':   //getNextDup
            status = delegate.getNextDup(key, data, lockMode);
            break;
        case 'O':   //getNextNoDup
            status = delegate.getNextNoDup(key, data, lockMode);
            break;
        case 'p':   //getPrev
            status = delegate.getPrev(key, data, lockMode);
            break;
        case 'P':   //getPrevDup
            status = delegate.getPrevDup(key, data, lockMode);
            break;
        case 'Q':   //getPrevNoDup
            status = delegate.getPrevNoDup(key, data, lockMode);
            break;
    }
    
    if (status == OperationStatus.SUCCESS) {
        return Pair.of(key, data);
    }
    
    return null;
}
 
開發者ID:jronrun,項目名稱:benayn,代碼行數:45,代碼來源:Berkeley.java


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