本文整理匯總了Java中com.sleepycat.je.EnvironmentConfig.setTxnTimeout方法的典型用法代碼示例。如果您正苦於以下問題:Java EnvironmentConfig.setTxnTimeout方法的具體用法?Java EnvironmentConfig.setTxnTimeout怎麽用?Java EnvironmentConfig.setTxnTimeout使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.sleepycat.je.EnvironmentConfig
的用法示例。
在下文中一共展示了EnvironmentConfig.setTxnTimeout方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: init
import com.sleepycat.je.EnvironmentConfig; //導入方法依賴的package包/類
@Override
public void init() {
EnvironmentConfig envConfig = new EnvironmentConfig();
commonConfig(envConfig);
envConfig.setCachePercent(config.getCachePercent());
envConfig.setAllowCreate(true);
if (config.isTransactional()) {
envConfig.setCachePercent(config.getCachePercent());
envConfig.setTransactional(config.isTransactional());
envConfig.setTxnTimeout(config.getTxnTimeout(), TimeUnit.SECONDS);
this.durability = config.isCommitSync() ? Durability.COMMIT_SYNC : Durability.COMMIT_NO_SYNC;
envConfig.setDurability(this.durability);
}
File repo_dir = new File(config.getRepoDir());
if (!repo_dir.exists()) {
repo_dir.mkdirs();
}
this.env = new Environment(repo_dir, envConfig);
cef = new CommandHandlerFactoryBDBImpl();
cursorFactoryBDBImp = new CursorFactoryBDBImp();
}
示例2: createEnv
import com.sleepycat.je.EnvironmentConfig; //導入方法依賴的package包/類
private void createEnv(boolean setTimeout,
long txnTimeoutVal,
long lockTimeoutVal)
throws DatabaseException {
EnvironmentConfig envConfig = TestUtils.initEnvConfig();
envConfig.setTransactional(true);
envConfig.setAllowCreate(true);
if (setTimeout) {
envConfig.setTxnTimeout(txnTimeoutVal);
envConfig.setLockTimeout(lockTimeoutVal);
}
env = new Environment(envHome, envConfig);
}
示例3: createEnv
import com.sleepycat.je.EnvironmentConfig; //導入方法依賴的package包/類
private void createEnv(boolean setTimeout,
long txnTimeoutVal,
long lockTimeoutVal)
throws DatabaseException {
EnvironmentConfig envConfig = TestUtils.initEnvConfig();
envConfig.setTransactional(true);
envConfig.setAllowCreate(true);
if (setTimeout) {
envConfig.setTxnTimeout(txnTimeoutVal);
envConfig.setLockTimeout(lockTimeoutVal);
}
env = new Environment(envHome, envConfig);
}