You are viewing a plain text version of this content. The canonical link for it is here.
Posted to muse-dev@ws.apache.org by "Chris Twiner (JIRA)" <ji...@apache.org> on 2009/01/28 09:12:59 UTC
[jira] Commented: (MUSE-297) XsdUtils.getLocalTimeString not thread
safe
[ https://issues.apache.org/jira/browse/MUSE-297?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12667959#action_12667959 ]
Chris Twiner commented on MUSE-297:
-----------------------------------
http://www.thedwick.com/blog/?p=131
its a performance pig to create one each use, so tls will be employed.
> XsdUtils.getLocalTimeString not thread safe
> -------------------------------------------
>
> Key: MUSE-297
> URL: https://issues.apache.org/jira/browse/MUSE-297
> Project: Muse
> Issue Type: Bug
> Components: WSDM Event Format (WEF)
> Affects Versions: 2.2.0
> Environment: Discovered on MacOS 10.5.5. But I believe it happens on all platforms
> Reporter: Hang Sun
> Assignee: Chris Twiner
> Priority: Blocker
> Fix For: 2.2.1
>
> Original Estimate: 2h
> Remaining Estimate: 2h
>
> The XsdUtils class uses a static SimpleDateFormat object to format date objects (see below). According to JDK:
> >>>
> Synchronization
> 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.
> <<<
> We did observe strange exceptions from that class when the code runs in multi-threaded environment. This forces us to put a hard sync. on unmarshal ManagementEvent objects.
> ------
> public class XsdUtils
> {
> //
> // Used to format dates in the XMLSchema dateTime format
> //
> private static DateFormat _FORMATTER =
> new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: muse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-dev-help@ws.apache.org