db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t.@apache.org
Subject svn commit: r391132 - /db/torque/runtime/trunk/src/java/org/apache/torque/util/LargeSelect.java
Date Mon, 03 Apr 2006 20:09:18 GMT
Author: tv
Date: Mon Apr  3 13:09:17 2006
New Revision: 391132

URL: http://svn.apache.org/viewcvs?rev=391132&view=rev
Log:
Attempt to fix the NullPointerException which happens when 
LargeSelect objects are de-serialized from Tomcat session
storage during reload.

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

Modified: db/torque/runtime/trunk/src/java/org/apache/torque/util/LargeSelect.java
URL: http://svn.apache.org/viewcvs/db/torque/runtime/trunk/src/java/org/apache/torque/util/LargeSelect.java?rev=391132&r1=391131&r2=391132&view=diff
==============================================================================
--- db/torque/runtime/trunk/src/java/org/apache/torque/util/LargeSelect.java (original)
+++ db/torque/runtime/trunk/src/java/org/apache/torque/util/LargeSelect.java Mon Apr  3 13:09:17
2006
@@ -135,6 +135,9 @@
  */
 public class LargeSelect implements Runnable, Serializable
 {
+    /** Serial version */
+    private static final long serialVersionUID = -1166842932571491942L;
+    
     /** The number of records that a page consists of.  */
     private int pageSize;
     /** The maximum number of records to maintain in memory. */
@@ -1288,7 +1291,12 @@
             throws IOException, ClassNotFoundException
     {
         inputStream.defaultReadObject();
-        startQuery(pageSize);
+        
+        // avoid NPE because of Tomcat de-serialization of sessions 
+        if (Torque.isInit())
+        {
+            startQuery(pageSize);
+        }
     }
 
     /**



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