本文整理匯總了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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}