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()); }
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); }
/** 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()); }