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


Java EnvironmentConfig.setLockTimeout方法代碼示例

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


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

示例1: 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);
}
 
開發者ID:nologic,項目名稱:nabs,代碼行數:15,代碼來源:TxnTimeoutTest.java

示例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);
}
 
開發者ID:nologic,項目名稱:nabs,代碼行數:15,代碼來源:TxnTimeoutTest.java

示例3: SorcerDatabase

import com.sleepycat.je.EnvironmentConfig; //導入方法依賴的package包/類
/**
 * Open all storage containers, indices, and catalogs.
 */
public SorcerDatabase(String homeDirectory)
    throws DatabaseException {
    // Open the Berkeley DB environment in transactional mode.
    //System.out.println("Opening environment in: " + homeDirectory);
    EnvironmentConfig envConfig = new EnvironmentConfig();
    envConfig.setLockTimeout(LOCK_TIMEOUT, TimeUnit.MILLISECONDS);
    envConfig.setTransactional(true);
    envConfig.setAllowCreate(true);
    envConfig.setSharedCache(true);
    env = new Environment(new File(homeDirectory), envConfig);

    // Set the Berkeley DB config for opening all stores.
    DatabaseConfig dbConfig = new DatabaseConfig();
    dbConfig.setTransactional(true);
    dbConfig.setAllowCreate(true);

    // Create the Serial class catalog.  This holds the serialized class
    // format for all database records of serial format.
    //
    Database catalogDb = env.openDatabase(null, CLASS_CATALOG, dbConfig);
    javaCatalog = new StoredClassCatalog(catalogDb);

    // Open the Berkeley DB database, the stores are opened
    // with no duplicate keys allowed.

    runtimeDb = env.openDatabase(null, RUNTIME_STORE, dbConfig);

    exertionDb = env.openDatabase(null, EXERTION_STORE, dbConfig);

    contextDb = env.openDatabase(null, CONTEXT_STORE, dbConfig);

    tableDb = env.openDatabase(null, TABLE_STORE, dbConfig);

    varDb = env.openDatabase(null, VAR_STORE, dbConfig);

    varModelDb = env.openDatabase(null, VAR_MODEL_STORE, dbConfig);
    
    uuidObjectDb = env.openDatabase(null, OBJECT_STORE, dbConfig);

    // Open the SecondaryDatabase for the name index of the provider in the runtime store.
    // Duplicate keys are allowed since more than one provider may be in
    // the same exertion.  A foreign key constraint is defined for the
    // name indices to ensure that a runtime only refers to
    // existing provider keys.  The CASCADE delete action means
    // that shipments will be deleted if their associated part or supplier
    // is deleted.
    //
    SecondaryConfig secConfig = new SecondaryConfig();
    secConfig.setTransactional(true);
    secConfig.setAllowCreate(true);
    secConfig.setSortedDuplicates(true);

    secConfig.setKeyCreator(new RuntimeByProviderNameKeyCreator(javaCatalog,
    		ProviderRuntime.class));
    runtimeByProviderNameDb = env.openSecondaryDatabase(null, RUNTIME_PROVIDER_NAME_INDEX,
                                                 runtimeDb, secConfig);
    secConfig.setForeignKeyDatabase(runtimeDb);
    secConfig.setForeignKeyDeleteAction(ForeignKeyDeleteAction.CASCADE);
    secConfig.setKeyCreator(new ExertionByRuntimeKeyCreator(javaCatalog,
                                                         ServiceExertion.class));
}
 
開發者ID:mwsobol,項目名稱:SORCER,代碼行數:65,代碼來源:SorcerDatabase.java


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