Package com.sleepycat.je

Examples of com.sleepycat.je.DatabaseConfig


      loader.create();
      loader.start();

      /* Verify the database name by trying to open it. */
      Environment env = new Environment(new File(envHome), null);
      DatabaseConfig dbConfig = new DatabaseConfig();
      dbConfig.setTransactional(transactional);
      Database db = env.openDatabase(null, dbName, dbConfig);
      db.close();
      env.close();
   }
View Full Code Here


  protected Object mutex = "WorkQueues_Mutex";

  public WorkQueues(Environment env, String dbName, boolean resumable) throws DatabaseException {
    this.env = env;
    this.resumable = resumable;
    DatabaseConfig dbConfig = new DatabaseConfig();
    dbConfig.setAllowCreate(true);
    dbConfig.setTransactional(resumable);
    dbConfig.setDeferredWrite(!resumable);
    urlsDB = env.openDatabase(null, dbName, dbConfig);
    webURLBinding = new WebURLTupleBinding();
  }
View Full Code Here

  {
   //*-- open the environment
   if (env == null)  { openEnv(DBDIR, false); if (env == null) return false; }

   //*-- create the primary database handle
   DatabaseConfig dbconfig = new DatabaseConfig();
   dbconfig.setAllowCreate(true);        //*-- allow creation of database 
   dbconfig.setSortedDuplicates(dupFlag);     //*-- no dups
   dbconfig.setExclusiveCreate(createFlag);   //*-- if true, disallow opening of an existing database
   dbconfig.setReadOnly(false);          //*-- set r/w status of the database
   //dbconfig.setTransactional(true);
   currentDB = env.openDatabase(null, dbname, dbconfig);
   dbMap.put(dbname, currentDB );
  }
  catch (DatabaseException dbe)
View Full Code Here

   //*-- check for errors and open the environment
   if ( (dbname.equals("")) || (!(existsDB(dbname))) ) return false;
   if (env != null) { openEnv(DBDIR, readOnly); if (env == null) return false; }

   //*-- create the primary database handle
   DatabaseConfig dbconfig = new DatabaseConfig();
   dbconfig.setAllowCreate(false);      //*-- disallow creation of database 
   dbconfig.setSortedDuplicates(dupFlag);     //*-- flag for dups
   dbconfig.setExclusiveCreate(readOnly);     //*-- allow opening of an existing database
   dbconfig.setReadOnly(readOnly);      //*-- set r/w status of the database
   // dbconfig.setTransactional(true);
   currentDB = env.openDatabase(null, dbname, dbconfig);
   dbMap.put(dbname, currentDB );
  }
  catch (DatabaseException dbe) { logger.error("Failed to open DB " + dbname + " " + dbe.getMessage() ); return false; }
View Full Code Here

                    files[i].delete();
            }
        }

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

        envConfig.setTransactional(true);
        envConfig.setAllowCreate(true);
        dbConfig.setAllowCreate(true);
        dbConfig.setTransactional(true);

        env = new Environment(dbHome, envConfig);

        Transaction txn = null;
View Full Code Here

    @Override
    public void performUpgrade(Environment environment, UpgradeInteractionHandler handler, String virtualHostName)
            throws DatabaseException, AMQStoreException
    {
        reportStarting(environment, 6);
        DatabaseConfig dbConfig = new DatabaseConfig();
        dbConfig.setTransactional(true);
        dbConfig.setAllowCreate(true);

        Database versionDb = environment.openDatabase(null, "CONFIG_VERSION", dbConfig);

        if(versionDb.count() == 0L)
        {
View Full Code Here

    }

    public void upgradeIfNecessary() throws AMQStoreException
    {
        boolean isEmpty = _environment.getDatabaseNames().isEmpty();
        DatabaseConfig dbConfig = new DatabaseConfig();
        dbConfig.setTransactional(true);
        dbConfig.setAllowCreate(true);

        Database versionDb = null;
        try
        {
            versionDb = _environment.openDatabase(null, VERSION_DB_NAME, dbConfig);
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

        environmentConfig.setAllowCreate(true);
        environmentConfig.setTransactional(true);
        environmentConfig.setSharedCache(false);
        environmentConfig.setCacheSize(CACHE_SIZE);

        DatabaseConfig databaseConfig = new DatabaseConfig();
        databaseConfig.setAllowCreate(true);
        databaseConfig.setTransactional(true);
        databaseConfig.setSortedDuplicates(true);

        long maxCacheSize = getMaxCacheUsage(environmentConfig, databaseConfig);

        assertEquals("MaxCacheSize > CACHE_SIZE", true, maxCacheSize > CACHE_SIZE);
        assertEquals("MaxCacheSize < 2 * CACHE_SIZE", true, maxCacheSize < 2 * CACHE_SIZE);
 
View Full Code Here

        environmentConfig.setAllowCreate(true);
        environmentConfig.setTransactional(true);
        environmentConfig.setSharedCache(true);
        environmentConfig.setCacheSize(CACHE_SIZE);

        DatabaseConfig databaseConfig = new DatabaseConfig();
        databaseConfig.setAllowCreate(true);
        databaseConfig.setTransactional(true);
        databaseConfig.setSortedDuplicates(true);

        long maxCacheSize = getMaxCacheUsage(environmentConfig, databaseConfig);
        // Include a buffer of 1mb.. since the actual cache usage can be a few
        // bytes more
        assertEquals("MaxCacheSize" + maxCacheSize + " <= CACHE_SIZE:" + CACHE_SIZE,
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.