Author: tv Date: Sun Aug 26 17:40:56 2018 New Revision: 1839232 URL: http://svn.apache.org/viewvc?rev=1839232&view=rev Log: Better cleanup
Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/TorqueInstance.java Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/TorqueInstance.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/TorqueInstance.java?rev=1839232&r1=1839231&r2=1839232&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/TorqueInstance.java (original) +++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/TorqueInstance.java Sun Aug 26 17:40:56 2018 @@ -86,10 +86,12 @@ public class TorqueInstance = new ConcurrentHashMap<String, Database>(); /** A repository of Manager instances. */ - private ConcurrentMap<String, AbstractBaseManager<?>> managers; + private final ConcurrentMap<String, AbstractBaseManager<?>> managers + = new ConcurrentHashMap<String, AbstractBaseManager<?>>(); /** A repository of Peer instances. */ - private ConcurrentMap<Class<?>, BasePeerImpl<?>> peers; + private final ConcurrentMap<Class<?>, BasePeerImpl<?>> peers + = new ConcurrentHashMap<Class<?>, BasePeerImpl<?>>(); /** A repository of idBroker instances. */ private final Set<IDBroker> idBrokers = new HashSet<IDBroker>(); @@ -854,7 +856,6 @@ public class TorqueInstance // shut down the cache managers managers.values().forEach(AbstractBaseManager::dispose); - managers.clear(); // shut down the data source factories TorqueException exception = null; @@ -906,8 +907,10 @@ public class TorqueInstance */ private void resetConfiguration() { - managers = new ConcurrentHashMap<String, AbstractBaseManager<?>>(); - peers = new ConcurrentHashMap<Class<?>, BasePeerImpl<?>>(); + managers.clear(); + peers.clear(); + // TODO: database maps should be re-created on restart + // databases.clear(); isInit = false; } --------------------------------------------------------------------- To unsubscribe, e-mail: torque-dev-unsubscr...@db.apache.org For additional commands, e-mail: torque-dev-h...@db.apache.org