Changeset: 5cc6927f19df for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5cc6927f19df
Modified Files:
        java/ChangeLog.Dec2011
        java/src/nl/cwi/monetdb/jdbc/MonetResultSet.java
Branch: Dec2011
Log Message:

ResultSet: make date parsers instance local

It was nice for performance to share the same date parsers between all
instances of MonetResultSet, but it caused problems in concurrent use,
so better have them instance local.  With some luck, Java does lazy/jit
instantiation, which means we still don't pay if we don't use
date-related getters.  Solves bug #2950.


diffs (33 lines):

diff --git a/java/ChangeLog.Dec2011 b/java/ChangeLog.Dec2011
--- a/java/ChangeLog.Dec2011
+++ b/java/ChangeLog.Dec2011
@@ -1,6 +1,11 @@
 # ChangeLog file for java
 # This file is updated with Maddlog
 
+* Tue Dec 20 2011 Fabian Groffen <[email protected]>
+- Resolved a concurrency problem where ResultSet's date-related getters
+  could cause odd stack traces when used by multiple threads at the
+  same time, bug #2950.
+
 * Mon Dec 19 2011 Fabian Groffen <[email protected]>
 - JDBC now implements JDBCv4.1 which makes it possible to be built with
   Java 7 and up.  JDBCv4.1 is a maintenance release of JDBCv4, and hence
diff --git a/java/src/nl/cwi/monetdb/jdbc/MonetResultSet.java 
b/java/src/nl/cwi/monetdb/jdbc/MonetResultSet.java
--- a/java/src/nl/cwi/monetdb/jdbc/MonetResultSet.java
+++ b/java/src/nl/cwi/monetdb/jdbc/MonetResultSet.java
@@ -1822,11 +1822,11 @@ public class MonetResultSet extends Mone
        }
 
        // This behaviour is according table B-6 of Sun JDBC Specification 3.0
-       private static SimpleDateFormat ts =
+       private SimpleDateFormat ts =
                new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-       private static SimpleDateFormat t =
+       private SimpleDateFormat t =
                new SimpleDateFormat("HH:mm:ss");
-       private static SimpleDateFormat d =
+       private SimpleDateFormat d =
                new SimpleDateFormat("yyyy-MM-dd");
        /**
         * Helper method which parses the date/time value for columns of type
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to