Trouble parsing datetime strings

2009-05-11 Thread David kerber
This is related to the performance issues discussed in the thread Performance with many small requests. When I reworked my servlet to synchronize only on pieces that needed to be synchronized, rather than on the entire request processing routine, I am now throwing an exception when parsing a

Re: Trouble parsing datetime strings

2009-05-11 Thread Xie Xiaodong
Hello, Date formats are not synchronized. It is recommended to create separate format instances for each thread. If multiple threads access a format concurrently, it must be synchronized externally. This is from the reference of JDK API. 2009/5/11 David kerber dcker...@verizon.net This is

RE: Trouble parsing datetime strings

2009-05-11 Thread Caldarale, Charles R
From: David kerber [mailto:dcker...@verizon.net] Subject: Trouble parsing datetime strings Declared at the class level, I have: private static final SimpleDateFormatsdfFullDateTime = new SimpleDateFormat( -MM-dd HH:mm:ss ); Oops. Read the fine print for SimpleDateFormat

Re: Trouble parsing datetime strings

2009-05-11 Thread Konstantin Kolinko
2009/5/11 David kerber dcker...@verizon.net: This is related to the performance issues discussed in the thread Performance with many small requests. When I reworked my servlet to synchronize only on pieces that needed to be synchronized, rather than on the entire request processing routine, I

Re: Trouble parsing datetime strings

2009-05-11 Thread David kerber
Konstantin Kolinko wrote: ... As the JavaDoc says http://java.sun.com/javase/6/docs/api/java/text/SimpleDateFormat.html Date formats are not synchronized. It is recommended to create separate format instances for each thread You may either create a new instance of SimpleDateFormat each time,

Re: Trouble parsing datetime strings

2009-05-11 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 David, On 5/11/2009 10:22 AM, David kerber wrote: From the quick reading I did, I imagine that will give me a bit of a performance hit compared to using ThreadLocal, but since I've never used the ThreadLocal pattern before, I didn't want to try