Package com.sleepycat.je

Examples of com.sleepycat.je.DatabaseConfig


        return _environment;
    }

    private void openDatabases() throws DatabaseException
    {
        DatabaseConfig dbConfig = new DatabaseConfig();
        dbConfig.setTransactional(true);
        dbConfig.setAllowCreate(true);

        //This is required if we are wanting read only access.
        dbConfig.setReadOnly(false);

        _configuredObjectsDb = openDatabase(CONFIGURED_OBJECTS, dbConfig);
        _messageMetaDataDb = openDatabase(MESSAGEMETADATADB_NAME, dbConfig);
        _messageContentDb = openDatabase(MESSAGECONTENTDB_NAME, dbConfig);
        _deliveryDb = openDatabase(DELIVERYDB_NAME, dbConfig);
View Full Code Here


        //envMutableConfig.setDurability(Durability.COMMIT_SYNC);
        //envMutableConfig.setDurability(Durability.COMMIT_NO_SYNC);
        envMutableConfig.setDurability(Durability.COMMIT_WRITE_NO_SYNC);
        dbEnv.setMutableConfig(envMutableConfig);

        DatabaseConfig dbConfig = new DatabaseConfig();
        dbConfig.setAllowCreate(true);
        //dbConfig.setDeferredWrite(true);
        db = dbEnv.openDatabase(null, "revs", dbConfig);

        head = dbEnv.openDatabase(null, "head", dbConfig);
View Full Code Here

        _upgrader = new Upgrader(_environment, getVirtualHostName());
    }

    private int getStoreVersion(Environment environment)
    {
        DatabaseConfig dbConfig = new DatabaseConfig();
        dbConfig.setTransactional(true);
        dbConfig.setAllowCreate(true);
        int storeVersion = -1;
        Database versionDb = null;
        Cursor cursor = null;
        try
        {
View Full Code Here

        _upgrader = new Upgrader(_environment, getVirtualHostName());
    }

    private int getStoreVersion()
    {
        DatabaseConfig dbConfig = new DatabaseConfig();
        dbConfig.setTransactional(true);
        dbConfig.setAllowCreate(true);
        int storeVersion = -1;
        Database versionDb = null;
        Cursor cursor = null;
        try
        {
View Full Code Here

    } catch (Exception e) {
      // 打开失败, 删除原来的内容再重新打开一次
      deleteAll(dataDir);
      env = new Environment(dataDir, envConfig);
    }
    DatabaseConfig dbConfig = new DatabaseConfig();
    dbConfig.setAllowCreate(true);
    dbConfig.setTransactional(true);
    classCatalog = new StoredClassCatalog(env.openDatabase(null,
        DATABASE_CLASS_NAME, dbConfig));
    keyBinding = new SerialBinding<IMetaData[]>(classCatalog, IMetaData[].class);
    dataBinding = new SerialBinding<ICache>(classCatalog, ICache.class);
    dbMain = env.openDatabase(null, DATABASE_MAIN_NAME, dbConfig);
View Full Code Here

        envConfig.setTransactional(true);
        envConfig.setAllowCreate(true);
        envConfig.setTxnNoSync(true);
        envConfig.setTxnWriteNoSync(true);

        final DatabaseConfig dbConfig = new DatabaseConfig();
        dbConfig.setTransactional(true);
        dbConfig.setAllowCreate(true);

        this.environment = new Environment(this.dbHome.getFile(), envConfig);
        this.ticketDb = this.environment.openDatabase(null, "ticketDb",
            dbConfig);
        this.catalogDb = this.environment.openDatabase(null, "catalogDb",
View Full Code Here

     * @throws DatabaseException
     */
    private void setup(File envHome, boolean readOnly) throws DatabaseException {

        EnvironmentConfig myEnvConfig = new EnvironmentConfig();
        dbConfig = new DatabaseConfig();

        // If the environment is read-only, then
        // make the databases read-only too.
        myEnvConfig.setReadOnly(readOnly);
        dbConfig.setReadOnly(readOnly);
View Full Code Here

        }
    }

    private void openDatabases(boolean readonly) throws DatabaseException
    {
        DatabaseConfig dbConfig = new DatabaseConfig();
        dbConfig.setTransactional(true);
        dbConfig.setAllowCreate(true);

        //This is required if we are wanting read only access.
        dbConfig.setReadOnly(readonly);

        _messageMetaDataDb = _environment.openDatabase(null, MESSAGEMETADATADB_NAME, dbConfig);
        _queueDb = _environment.openDatabase(null, QUEUEDB_NAME, dbConfig);
        _exchangeDb = _environment.openDatabase(null, EXCHANGEDB_NAME, dbConfig);
        _queueBindingsDb = _environment.openDatabase(null, QUEUEBINDINGSDB_NAME, dbConfig);
View Full Code Here

    final EnvironmentConfig envConfig = new EnvironmentConfig();
    envConfig.setTransactional(true);
    envConfig.setAllowCreate(true);

    env = new Environment(dataDirectory, envConfig);
    final DatabaseConfig dbConfig = new DatabaseConfig();
    dbConfig.setTransactional(true);
    dbConfig.setAllowCreate(true);
    dbConfig.setSortedDuplicates(true);
    db = env.openDatabase(null, "nigori", dbConfig);
  }
View Full Code Here

    }

    private Database openDb(String name, boolean duplicates)
        throws DatabaseException {

        DatabaseConfig dbConfig = new DatabaseConfig();
        dbConfig.setTransactional(isTransactional);
        dbConfig.setAllowCreate(true);
        dbConfig.setSortedDuplicates(duplicates);

        Transaction txn = txnBegin();
        try {
            return env.openDatabase(txn, name, dbConfig);
        } finally {
View Full Code Here

TOP

Related Classes of com.sleepycat.je.DatabaseConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.