db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r1098661 - /db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/LargeSelect.java
Date Mon, 02 May 2011 16:53:46 GMT
Author: tfischer
Date: Mon May  2 16:53:46 2011
New Revision: 1098661

URL: http://svn.apache.org/viewvc?rev=1098661&view=rev
Log:
improved logging

Modified:
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/LargeSelect.java

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/LargeSelect.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/LargeSelect.java?rev=1098661&r1=1098660&r2=1098661&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/LargeSelect.java
(original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/LargeSelect.java
Mon May  2 16:53:46 2011
@@ -723,7 +723,7 @@ public class LargeSelect<T> implements R
                 log.debug("run(): - results.size(): " + results.size());
             }
         }
-        catch (TorqueException e)
+        catch (Exception e)
         {
             log.error(e);
         }
@@ -731,6 +731,10 @@ public class LargeSelect<T> implements R
         {
             Torque.closeConnection(conn);
             threadRunning = false;
+            if (log.isDebugEnabled())
+            {
+                log.debug("Exiting query thread");
+            }
         }
     }
 
@@ -741,14 +745,23 @@ public class LargeSelect<T> implements R
      */
     private synchronized void startQuery(int initialSize)
     {
+        if (log.isDebugEnabled())
+        {
+            log.debug("Starting query thread");
+        }
         if (!threadRunning)
         {
             pageSize = initialSize;
             currentlyFilledTo = -1;
             queryCompleted = false;
             thread = new Thread(this);
+            thread.setName("LargeSelect query Thread");
             thread.start();
             threadRunning = true;
+            if (log.isDebugEnabled())
+            {
+                log.debug("query thread started");
+            }
         }
     }
 
@@ -760,6 +773,10 @@ public class LargeSelect<T> implements R
      */
     private synchronized void stopQuery() throws TorqueException
     {
+        if (log.isDebugEnabled())
+        {
+            log.debug("stopQuery(): Stopping query thread");
+        }
         if (threadRunning)
         {
             killThread = true;
@@ -775,6 +792,10 @@ public class LargeSelect<T> implements R
                 }
             }
             killThread = false;
+            if (log.isDebugEnabled())
+            {
+                log.debug("stopQuery(): query thread stopped.");
+            }
         }
     }
 



---------------------------------------------------------------------
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