move initialization to poolStarted
authorfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 11 Dec 2008 22:19:54 +0000 (22:19 +0000)
committerfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 11 Dec 2008 22:19:54 +0000 (22:19 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@725843 13f79535-47bb-0310-9956-ffa450edef68

modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReport.java

index f235973..9e3bf7f 100644 (file)
@@ -169,9 +169,11 @@ public class SlowQueryReport extends AbstractCreateStatementInterceptor  {
     /**
      * {@inheritDoc}
      */
-    public void reset(ConnectionPool parent, PooledConnection con) {
+    @Override
+    public void poolStarted(ConnectionPool pool) {
+        super.poolStarted(pool);
         //see if we already created a map for this pool
-        queries = SlowQueryReport.perPoolStats.get(parent.getName());
+        queries = SlowQueryReport.perPoolStats.get(pool.getName());
         if (queries==null) {
             //create the map to hold our stats
             //however TODO we need to improve the eviction
@@ -179,14 +181,13 @@ public class SlowQueryReport extends AbstractCreateStatementInterceptor  {
             queries = new ConcurrentHashMap<String,QueryStats>() {
                 
             };
-            if (perPoolStats.putIfAbsent(parent.getName(), queries)!=null) {
+            if (perPoolStats.putIfAbsent(pool.getName(), queries)!=null) {
                 //there already was one
-                queries = SlowQueryReport.perPoolStats.get(parent.getName());
+                queries = SlowQueryReport.perPoolStats.get(pool.getName());
             }
         }
     }
     
-    
     /**
      * {@inheritDoc}
      */