Eliminate double-database close log messages

* BdbModule.java
   split openDatabase() to openManagedDatabase() (auto-closed) and plain openDatabase() (caller-closes)
   set TempStoredSortedMap to use unmanaged openDatabase
* (others)
   use openManagedDatabase()
This commit is contained in:
gojomo committed 2009-10-04 05:06:14 +00:00
1 parent c3914ea943
commit c05044d51b
8 files changed
+45 -20

No files matched your search

@@ -123,7 +123,7 @@ implements Serializable, Checkpointable {
dbConfig.setAllowCreate(!recycle);
// Make database deferred write: URLs that are added then removed
// before a page-out is required need never cause disk IO.
db = bdb.openDatabase("pending", dbConfig, recycle);
db = bdb.openManagedDatabase("pending", dbConfig, recycle);
}
return new BdbMultipleWorkQueues(db, bdb.getClassCatalog());
@@ -248,7 +248,7 @@ implements Serializable, Checkpointable {
inactiveQueuesByPrecedence = new TreeMap<Integer,Queue<String>>();
Database retiredQueuesDb;
retiredQueuesDb = bdb.openDatabase("retiredQueues",
retiredQueuesDb = bdb.openManagedDatabase("retiredQueues",
StoredQueue.databaseConfig(), false);
retiredQueues = new StoredQueue<String>(retiredQueuesDb,
String.class, null);
@@ -270,7 +270,7 @@ implements Serializable, Checkpointable {
Queue<String> createInactiveQueueForPrecedence(int precedence) {
Database inactiveQueuesDb;
try {
inactiveQueuesDb = bdb.openDatabase("inactiveQueues-"+precedence,
inactiveQueuesDb = bdb.openManagedDatabase("inactiveQueues-"+precedence,
StoredQueue.databaseConfig(), false);
} catch (DatabaseException e) {
throw new RuntimeException(e);
@@ -87,7 +87,7 @@ implements Lifecycle {
StoredClassCatalog classCatalog = bdb.getClassCatalog();
BdbModule.BdbConfig dbConfig = PersistProcessor.historyDatabaseConfig();
historyDb = bdb.openDatabase(dbName, dbConfig, true);
historyDb = bdb.openManagedDatabase(dbName, dbConfig, true);
historyMap = new StoredSortedMap(historyDb,
new StringBinding(), new SerialBinding(classCatalog,
Map.class), true);
@@ -103,7 +103,7 @@ implements Lifecycle, Serializable {
try {
BdbModule.BdbConfig config = getDatabaseConfig();
config.setAllowCreate(true);
initialize(bdb.openDatabase(DB_NAME, config, false));
initialize(bdb.openManagedDatabase(DB_NAME, config, false));
} catch (DatabaseException e) {
throw new IllegalStateException(e);
}