Package com.sleepycat.db

Examples of com.sleepycat.db.EnvironmentConfig


      defaultTxnConfig.setReadCommitted(false);
      break;
  default:
      throw new AssertionError();
  }
  EnvironmentConfig config = new EnvironmentConfig();
  config.setAllowCreate(true);
  config.setCacheSize(cacheSize);
  config.setErrorHandler(new LoggingErrorHandler());
  config.setInitializeCache(true);
  config.setInitializeLocking(true);
  config.setInitializeLogging(true);
  config.setLockDetectMode(LockDetectMode.YOUNGEST);
  config.setLockTimeout(lockTimeoutMicros);
  config.setLogAutoRemove(removeLogs);
  config.setMessageHandler(new LoggingMessageHandler());
  config.setRunRecovery(true);
  config.setTransactional(true);
  config.setTxnWriteNoSync(!flushToDisk);
  try {
      env = new Environment(new File(directory), config);
  } catch (FileNotFoundException e) {
      throw new DbDatabaseException(
    "DataStore directory does not exist: " + directory);
View Full Code Here


                if (name.startsWith("__") || name.startsWith("log."))
                    files[i].delete();
            }
        }

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

        envConfig.setTransactional(true);
        envConfig.setInitializeCache(true);
        envConfig.setInitializeLocking(true);
        envConfig.setInitializeLogging(true);
        envConfig.setAllowCreate(true);
        envConfig.setThreaded(true);
        dbConfig.setAllowCreate(true);
        dbConfig.setType(DatabaseType.BTREE);

        env = new Environment(dbHome, envConfig);
View Full Code Here

                if (name.startsWith("__") || name.startsWith("log."))
                    files[i].delete();
            }
        }

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

        envConfig.setTransactional(true);
        envConfig.setInitializeCache(true);
        envConfig.setInitializeLocking(true);
        envConfig.setInitializeLogging(true);
        envConfig.setAllowCreate(true);
        envConfig.setThreaded(true);
        dbConfig.setAllowCreate(true);
        dbConfig.setType(DatabaseType.BTREE);

        env = new Environment(dbHome, envConfig);
View Full Code Here

                if (name.startsWith("__") || name.startsWith("log."))
                    files[i].delete();
            }
        }

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

        envConfig.setTransactional(true);
        envConfig.setInitializeCache(true);
        envConfig.setInitializeLocking(true);
        envConfig.setInitializeLogging(true);
        envConfig.setAllowCreate(true);
        envConfig.setThreaded(true);
        dbConfig.setAllowCreate(true);
        dbConfig.setType(DatabaseType.BTREE);

        env = new Environment(dbHome, envConfig);
View Full Code Here

    }

    private void open()
        throws IOException, DatabaseException {

        EnvironmentConfig envConfig = TestEnv.BDB.getConfig();
        envConfig.setAllowCreate(true);
        env = new Environment(envHome, envConfig);

        openCatalog();
    }
View Full Code Here

    // for us.
    public void setup()
        throws DatabaseException {

        try {
            EnvironmentConfig envConfig = new EnvironmentConfig();
            StoreConfig storeConfig = new StoreConfig();

            // Open the environment and entity store
            envmnt = new Environment(envHome, envConfig);
            store = new EntityStore(envmnt, "EntityStore", storeConfig);
View Full Code Here

        throws DatabaseException, FileNotFoundException {

        // Open the Berkeley DB environment in transactional mode.
        //
        System.out.println("Opening environment in: " + homeDirectory);
        EnvironmentConfig envConfig = new EnvironmentConfig();
        envConfig.setTransactional(true);
        envConfig.setAllowCreate(true);
        envConfig.setInitializeCache(true);
        envConfig.setInitializeLocking(true);
        env = new Environment(new File(homeDirectory), envConfig);

        // Set the Berkeley DB config for opening all stores.
        //
        DatabaseConfig dbConfig = new DatabaseConfig();
View Full Code Here

   // The setup() method opens the environment and store
    // for us.
    public void setup()
        throws DatabaseException {

        EnvironmentConfig envConfig = new EnvironmentConfig();
        StoreConfig storeConfig = new StoreConfig();

        envConfig.setAllowCreate(true);
        storeConfig.setAllowCreate(true);

        try {
            // Open the environment and entity store
            envmnt = new Environment(envHome, envConfig);
View Full Code Here

    }

    void openEnv()
        throws IOException, DatabaseException {

        EnvironmentConfig config = TestEnv.TXN.getConfig();
        config.setAllowCreate(true);
        env = new Environment(envHome, config);
    }
View Full Code Here

        throws DatabaseException, FileNotFoundException {

        // Open the Berkeley DB environment in transactional mode.
        //
        System.out.println("Opening environment in: " + homeDirectory);
        EnvironmentConfig envConfig = new EnvironmentConfig();
        envConfig.setTransactional(true);
        envConfig.setAllowCreate(true);
        envConfig.setInitializeCache(true);
        envConfig.setInitializeLocking(true);
        env = new Environment(new File(homeDirectory), envConfig);

        // Set the Berkeley DB config for opening all stores.
        //
        DatabaseConfig dbConfig = new DatabaseConfig();
View Full Code Here

TOP

Related Classes of com.sleepycat.db.EnvironmentConfig

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.