Examples of openDatabase()


Examples of com.sleepycat.je.Environment.openDatabase()

            // Make two databases
            DatabaseConfig dbConfig = new DatabaseConfig();
            dbConfig.setTransactional(true);
            dbConfig.setAllowCreate(true);
            Database dbHandleAbcd = env.openDatabase(null, "abcd", dbConfig);
            Database dbHandleXyz = env.openDatabase(null, "xyz", dbConfig);

            // Can we get them back?
            dbConfig.setAllowCreate(false);
            Database newAbcdHandle = env.openDatabase(null, "abcd", dbConfig);
            Database newXyzHandle = env.openDatabase(null, "xyz", dbConfig);
View Full Code Here

Examples of com.sleepycat.je.Environment.openDatabase()

            Database dbHandleAbcd = env.openDatabase(null, "abcd", dbConfig);
            Database dbHandleXyz = env.openDatabase(null, "xyz", dbConfig);

            // Can we get them back?
            dbConfig.setAllowCreate(false);
            Database newAbcdHandle = env.openDatabase(null, "abcd", dbConfig);
            Database newXyzHandle = env.openDatabase(null, "xyz", dbConfig);

            dbHandleAbcd.close();
            dbHandleXyz.close();
            newAbcdHandle.close();
View Full Code Here

Examples of com.sleepycat.je.Environment.openDatabase()

            Database dbHandleXyz = env.openDatabase(null, "xyz", dbConfig);

            // Can we get them back?
            dbConfig.setAllowCreate(false);
            Database newAbcdHandle = env.openDatabase(null, "abcd", dbConfig);
            Database newXyzHandle = env.openDatabase(null, "xyz", dbConfig);

            dbHandleAbcd.close();
            dbHandleXyz.close();
            newAbcdHandle.close();
            newXyzHandle.close();
View Full Code Here

Examples of com.sleepycat.je.Environment.openDatabase()

            /* Open the db. */
            DatabaseConfig dbConfig = new DatabaseConfig();
            dbConfig.setReadOnly(true);
            DbInternal.setUseExistingConfig(dbConfig, true);
            Database db = envHandle.openDatabase(null, dbName, dbConfig);

            DatabaseEntry foundData = new DatabaseEntry();
            if (dumpAll) {
                Cursor cursor = db.openCursor(null, null);
                DatabaseEntry foundKey = new DatabaseEntry();
View Full Code Here

Examples of com.sleepycat.je.Environment.openDatabase()

      DbInternal.envGetEnvironmentImpl(env).getFileManager();

        DatabaseConfig dbConfig = new DatabaseConfig();
        dbConfig.setAllowCreate(true);
        Database db1 =
      env.openDatabase(null, "db1", dbConfig);

        Database db2 =
      env.openDatabase(null, "db2", dbConfig);

  DatabaseEntry key = new DatabaseEntry();
View Full Code Here

Examples of com.sleepycat.je.Environment.openDatabase()

        dbConfig.setAllowCreate(true);
        Database db1 =
      env.openDatabase(null, "db1", dbConfig);

        Database db2 =
      env.openDatabase(null, "db2", dbConfig);

  DatabaseEntry key = new DatabaseEntry();
  DatabaseEntry data = new DatabaseEntry();
  IntegerBinding.intToEntry(1, key);
  data.setData(new byte[100000]);
View Full Code Here

Examples of com.sleepycat.je.Environment.openDatabase()

        env = new Environment(envHome, envConfig);
  fileManager = DbInternal.envGetEnvironmentImpl(env).getFileManager();
        assertEquals("Should have 1 as current file", 1L,
                     fileManager.getCurrentFileNum());

  db2 = env.openDatabase(null, "db2", dbConfig);

        for (int i = 0; i < 250; i++) {
            assertEquals(OperationStatus.SUCCESS, db2.put(null, key, data));
  }
View Full Code Here

Examples of com.sleepycat.je.Environment.openDatabase()

            assertEquals(OperationStatus.SUCCESS, db2.put(null, key, data));
  }

  db2.close();
  env.cleanLog();
  db1 = env.openDatabase(null, "db1", dbConfig);
  db1.get(null, key, data, null);
  db1.close();
  env.close();
    }
View Full Code Here

Examples of com.sleepycat.je.Environment.openDatabase()

                dbEnvConfig.setLockTimeout(5, TimeUnit.SECONDS);
                environment = new Environment(dir, dbEnvConfig);
                final DatabaseConfig dbConfig = new DatabaseConfig();
                dbConfig.setTransactional(true);
                dbConfig.setAllowCreate(true);
                database = environment.openDatabase(null, name, dbConfig);
            } catch (final Exception ex) {
                LOGGER.error("Could not create FlumePersistentManager", ex);
                // For consistency, close database as well as environment even though it should never happen since the
                // database is that last thing in the block above, but this does guard against a future line being
                // inserted at the end that would bomb (like some debug logging).
View Full Code Here

Examples of com.sleepycat.je.Environment.openDatabase()

                dbEnvConfig.setAllowCreate(true);
                final Environment environment = new Environment(dir, dbEnvConfig);
                final DatabaseConfig dbConfig = new DatabaseConfig();
                dbConfig.setTransactional(false);
                dbConfig.setAllowCreate(true);
                database = environment.openDatabase(null, name, dbConfig);
            } catch (final Exception ex) {
                LOGGER.error("Could not create FlumePersistentManager", ex);
                return null;
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.