summaryrefslogtreecommitdiff
path: root/src/main/java/com
diff options
context:
space:
mode:
authorBrian S. O'Neill <bronee@gmail.com>2012-06-07 13:22:03 +0000
committerBrian S. O'Neill <bronee@gmail.com>2012-06-07 13:22:03 +0000
commitae2b23ebef3a5d4e77e43e135a7d210e91dc7952 (patch)
tree2221cfa0eeb4b26f858dcefc889063e04bac45c9 /src/main/java/com
parentf27253e0cd590a60de2dc389c89be661d22d0f92 (diff)
Clear pools on shutdown.
Diffstat (limited to 'src/main/java/com')
-rw-r--r--src/main/java/com/amazon/carbonado/spi/AbstractRepository.java2
-rw-r--r--src/main/java/com/amazon/carbonado/util/AbstractPool.java4
2 files changed, 6 insertions, 0 deletions
diff --git a/src/main/java/com/amazon/carbonado/spi/AbstractRepository.java b/src/main/java/com/amazon/carbonado/spi/AbstractRepository.java
index c37f2c4..8a9a0cc 100644
--- a/src/main/java/com/amazon/carbonado/spi/AbstractRepository.java
+++ b/src/main/java/com/amazon/carbonado/spi/AbstractRepository.java
@@ -321,6 +321,8 @@ public abstract class AbstractRepository<Txn>
doShutdown(repository, suspendThreads);
} finally {
repository.mHasShutdown = true;
+ repository.mStoragePool.clear();
+ repository.mSequencePool.clear();
mRepository.clear();
repository.info("Closed repository \"" + repository.getName() + '"');
}
diff --git a/src/main/java/com/amazon/carbonado/util/AbstractPool.java b/src/main/java/com/amazon/carbonado/util/AbstractPool.java
index e14c387..d8bcc4e 100644
--- a/src/main/java/com/amazon/carbonado/util/AbstractPool.java
+++ b/src/main/java/com/amazon/carbonado/util/AbstractPool.java
@@ -88,6 +88,10 @@ public abstract class AbstractPool<K, V, E extends Exception> {
return mValues.values();
}
+ public void clear() {
+ mValues.clear();
+ }
+
/**
* Return a new value instance.
*/