From ae2b23ebef3a5d4e77e43e135a7d210e91dc7952 Mon Sep 17 00:00:00 2001 From: "Brian S. O'Neill" Date: Thu, 7 Jun 2012 13:22:03 +0000 Subject: Clear pools on shutdown. --- src/main/java/com/amazon/carbonado/spi/AbstractRepository.java | 2 ++ src/main/java/com/amazon/carbonado/util/AbstractPool.java | 4 ++++ 2 files changed, 6 insertions(+) (limited to 'src/main/java/com/amazon') 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 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 { return mValues.values(); } + public void clear() { + mValues.clear(); + } + /** * Return a new value instance. */ -- cgit v1.2.3