db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t.@apache.org
Subject svn commit: r1839232 - /db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/TorqueInstance.java
Date Sun, 26 Aug 2018 17:40:57 GMT
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-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message