Menu

#9 IFXDate, IFXDatetime, IFXTime

open
nobody
Core (8)
5
2009-05-06
2009-05-06
No

The base objects IFXDate, IFXDatetime and IFXTime are not thread safe due to the declaration at the beginning of each class that looks like "private static final SimpleDateFormat = new SimpleDateFormat("dd-MM-yyyy");"

When multiple threads are using these objects at the same time several parsing exceptions occur and in other cases the result is weird dates like "01/01/11233". I managed to fix this problem by Changing the declaration to "private static final String sdf= "dd-MM-yyyy";" and then I used "new SimpleDateFormat(sdf)" in the getString and setString methods.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB