예제 #1
0
 void initExisting__wrappee__base(
     Environment env, Locker locker, DatabaseImpl databaseImpl, DatabaseConfig dbConfig)
     throws DatabaseException {
   validateConfigAgainstExistingDb(dbConfig, databaseImpl);
   init(env, dbConfig);
   this.databaseImpl = databaseImpl;
   databaseImpl.addReferringHandle(this);
   configuration.setSortedDuplicates(databaseImpl.getSortedDuplicates());
   configuration.setTransactional(databaseImpl.isTransactional());
 }
예제 #2
0
 void initNew__wrappee__base(
     Environment env, Locker locker, String databaseName, DatabaseConfig dbConfig)
     throws DatabaseException {
   if (dbConfig.getReadOnly()) {
     throw new DatabaseException(
         "DatabaseConfig.setReadOnly() must be set to false " + "when creating a Database");
   }
   init(env, dbConfig);
   EnvironmentImpl environmentImpl = DbInternal.envGetEnvironmentImpl(envHandle);
   databaseImpl = environmentImpl.createDb(locker, databaseName, dbConfig, this);
   databaseImpl.addReferringHandle(this);
 }
예제 #3
0
파일: Database.java 프로젝트: ppires/CIDE
  /** Open a database, called by Environment. */
  void initExisting(
      Environment env, Locker locker, DatabaseImpl databaseImpl, DatabaseConfig dbConfig)
      throws DatabaseException {

    /*
     * Make sure the configuration used for the open is compatible with the
     * existing databaseImpl.
     */
    validateConfigAgainstExistingDb(dbConfig, databaseImpl);

    init(env, dbConfig);
    this.databaseImpl = databaseImpl;
    databaseImpl.addReferringHandle(this);

    /*
     * Copy the duplicates and transactional properties of the underlying
     * database, in case the useExistingConfig property is set.
     */
    configuration.setSortedDuplicates(databaseImpl.getSortedDuplicates());
    configuration.setTransactional(databaseImpl.isTransactional());
  }