tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ronald Klop <ron...@klop.yi.org>
Subject NullPointerException in JDBCStore
Date Wed, 04 Sep 2002 00:25:41 GMT
Hello,

I get a NullPointerException in org.apache.catalina.session.JDBCStore. 
(Tomcat 4.0.4 and 4.1.9)
I think it can be solved with the following patch.
Is there a possibility for this to be committed?


--- JDBCStore-old.java  Wed Sep  4 02:13:53 2002
+++ JDBCStore.java      Wed Sep  4 02:18:12 2002
@@ -759,37 +759,43 @@
              }

              try {
-                preparedSizeSql.close();
+                if (preparedSizeSql != null)
+                    preparedSizeSql.close();
              } catch (SQLException e) {
                  ;
              }

              try {
-                preparedKeysSql.close();
+                if (preparedKeysSql != null)
+                    preparedKeysSql.close();
              } catch (SQLException e) {
                  ;
              }

              try {
-                preparedSaveSql.close();
+                if (preparedSaveSql != null)
+                    preparedSaveSql.close();
              } catch (SQLException e) {
                  ;
              }

              try {
-                preparedClearSql.close();
+                if (preparedClearSql != null)
+                    preparedClearSql.close();
              } catch (SQLException e) {
                  ;
              }

              try {
-                preparedRemoveSql.close();
+                if (preparedRemoveSql != null)
+                    preparedRemoveSql.close();
              } catch (SQLException e) {
                  ;
              }

              try {
-                preparedLoadSql.close();
+                if (preparedLoadSql != null)
+                    preparedLoadSql.close();
              } catch (SQLException e) {
                  ;
              }


-- 
  Ronald Klop
  Amsterdam, The Netherlands


--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message