mirror of
https://github.com/internetarchive/heritrix3.git
synced 2026-11-15 10:20:47 +00:00
[HER-1706] PersistLoadProcessor and PersistStoreProcessor can't share same BdbModule
* BdbModule.java
allow Database instance reuse if BdbConfig is identical instance
* PersistProcessor.java
convert shared BdbConfig for history db to static constant HISTORY_DB_CONFIG
* PersistOnlineProcessor.java
use HISTORY_DB_CONFIG, don't close possibly-shared DB on stop()
* PrecedenceLoader.java, PreloadedUriPrecedencePolicy.java
use HISTORY_DB_CONFIG
This commit is contained in:
1 parent
0497efbb32
commit
dd0ca367c3
5 files changed
+15
-12
No files matched your search
@@ -329,6 +329,12 @@ Serializable, Closeable {
|
||||
"BdbModule not started; as a Lifecycle bean it must not be an inner bean.");
|
||||
}
|
||||
if (databases.containsKey(name)) {
|
||||
DatabasePlusConfig dpc = databases.get(name);
|
||||
if(dpc.config == config) {
|
||||
// object-identical configs: OK to share DB
|
||||
return dpc.database;
|
||||
}
|
||||
// unshared config object: might be name collision; error
|
||||
throw new IllegalStateException("Database already exists: " +name);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user