private synchronized void openDatabase ( ) { if ( database != null ) return ; DatabaseConfig dbConfig = new DatabaseConfig ( ) ; dbConfig . setReadOnly ( readOnly ) ; dbConfig . setAllowCreate ( ! readOnly ) ; if ( ! readOnly ) dbConfig . setDeferredWrite ( true ) ; database = myEnv . openDatabase ( null , collectionName , dbConfig ) ; openDatabases . add ( this ) ; }
assumes only one open at a time ; could have MetadataManagers share open databases