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


Java EnvironmentConfig.setTxnSerializableIsolation方法代碼示例

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


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

示例1: initEnvConfig

import com.sleepycat.je.EnvironmentConfig; //導入方法依賴的package包/類
/**
 * Called by each unit test to enforce isolation level settings specified
 * in the isolationLevel system property.  Other system properties or
 * default settings may be applied in the future.
 */
public static EnvironmentConfig initEnvConfig() {

    EnvironmentConfig config = new EnvironmentConfig();
    String val = System.getProperty("isolationLevel");
    if (val != null && val.length() > 0) {
        if ("serializable".equals(val)) {
            config.setTxnSerializableIsolation(true);
        } else if ("readCommitted".equals(val)) {
            DbInternal.setTxnReadCommitted(config, true);
        } else {
            throw new IllegalArgumentException
                ("Unknown isolationLevel system property value: " + val);
        }
    }
    return config;
}
 
開發者ID:nologic,項目名稱:nabs,代碼行數:22,代碼來源:TestUtils.java

示例2: testEnvironmentConfig

import com.sleepycat.je.EnvironmentConfig; //導入方法依賴的package包/類
public void testEnvironmentConfig()
    throws DatabaseException, InterruptedException {

    EnvironmentConfig config = TestUtils.initEnvConfig();
    /* Control over isolation level is required by this test. */
    TestUtils.clearIsolationLevel(config);
    checkSerializable(false, config, null, null);

    config.setTxnSerializableIsolation(true);
    checkSerializable(true, config, null, null);
}
 
開發者ID:nologic,項目名稱:nabs,代碼行數:12,代碼來源:PhantomTest.java

示例3: testReadUncommittedLockMode

import com.sleepycat.je.EnvironmentConfig; //導入方法依賴的package包/類
public void testReadUncommittedLockMode()
    throws DatabaseException, InterruptedException {

    EnvironmentConfig envConfig = TestUtils.initEnvConfig();
    /* Control over isolation level is required by this test. */
    TestUtils.clearIsolationLevel(envConfig);
    envConfig.setTxnSerializableIsolation(true);

    checkSerializable(false, envConfig, null, LockMode.READ_UNCOMMITTED);
}
 
開發者ID:nologic,項目名稱:nabs,代碼行數:11,代碼來源:PhantomTest.java

示例4: openEnv

import com.sleepycat.je.EnvironmentConfig; //導入方法依賴的package包/類
/**
 * Opens the environment and database.
 */
private void openEnv()
    throws DatabaseException {

    EnvironmentConfig envConfig = TestUtils.initEnvConfig();
    envConfig.setAllowCreate(true);
    envConfig.setTransactional(true);
    envConfig.setTxnSerializableIsolation(true);

    /* Disable the daemons so the don't interfere with stats. */
    envConfig.setConfigParam
        (EnvironmentParams.ENV_RUN_EVICTOR.getName(), "false");
    envConfig.setConfigParam
        (EnvironmentParams.ENV_RUN_CLEANER.getName(), "false");
    envConfig.setConfigParam
        (EnvironmentParams.ENV_RUN_CHECKPOINTER.getName(), "false");
    envConfig.setConfigParam
        (EnvironmentParams.ENV_RUN_INCOMPRESSOR.getName(), "false");

    env = new Environment(envHome, envConfig);

    DatabaseConfig dbConfig = new DatabaseConfig();
    dbConfig.setAllowCreate(true);
    dbConfig.setTransactional(true);
    dbConfig.setSortedDuplicates(dups);
    db = env.openDatabase(null, "PhantomRestartTest", dbConfig);
}
 
開發者ID:nologic,項目名稱:nabs,代碼行數:30,代碼來源:PhantomRestartTest.java

示例5: openEnv

import com.sleepycat.je.EnvironmentConfig; //導入方法依賴的package包/類
/**
 * Opens the environment and database.
 */
private void openEnv()
    throws DatabaseException {

    EnvironmentConfig envConfig = TestUtils.initEnvConfig();
    envConfig.setAllowCreate(true);
    envConfig.setTransactional(true);
    envConfig.setTxnSerializableIsolation(true);
    
    /* Disable the daemons so the don't interfere with stats. */
    envConfig.setConfigParam
        (EnvironmentParams.ENV_RUN_EVICTOR.getName(), "false");
    envConfig.setConfigParam
        (EnvironmentParams.ENV_RUN_CLEANER.getName(), "false");
    envConfig.setConfigParam
        (EnvironmentParams.ENV_RUN_CHECKPOINTER.getName(), "false");
    envConfig.setConfigParam
        (EnvironmentParams.ENV_RUN_INCOMPRESSOR.getName(), "false");
   
    env = new Environment(envHome, envConfig);

    DatabaseConfig dbConfig = new DatabaseConfig();
    dbConfig.setAllowCreate(true);
    dbConfig.setTransactional(true);
    dbConfig.setSortedDuplicates(dups);
    db = env.openDatabase(null, "PhantomRestartTest", dbConfig);
}
 
開發者ID:nologic,項目名稱:nabs,代碼行數:30,代碼來源:PhantomRestartTest.java

示例6: clearIsolationLevel

import com.sleepycat.je.EnvironmentConfig; //導入方法依賴的package包/類
/**
 * If a unit test needs to override the isolation level, it should call
 * this method after calling initEnvConfig.
 */
public static void clearIsolationLevel(EnvironmentConfig config) {
    DbInternal.setTxnReadCommitted(config, false);
    config.setTxnSerializableIsolation(false);
}
 
開發者ID:nologic,項目名稱:nabs,代碼行數:9,代碼來源:TestUtils.java


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