You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Julien Lavigne du Cadet (JIRA)" <qp...@incubator.apache.org> on 2009/07/14 12:19:14 UTC

[jira] Commented: (QPID-1972) UUID.randomUUID() is not thread-safe

    [ https://issues.apache.org/jira/browse/QPID-1972?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12730769#action_12730769 ] 

Julien Lavigne du Cadet commented on QPID-1972:
-----------------------------------------------

Please do not consider this patch for now, there are issues with it.

> UUID.randomUUID() is not thread-safe
> ------------------------------------
>
>                 Key: QPID-1972
>                 URL: https://issues.apache.org/jira/browse/QPID-1972
>             Project: Qpid
>          Issue Type: Bug
>          Components: Dot Net Client
>    Affects Versions: 0.5
>         Environment: .net API
>            Reporter: Julien Lavigne du Cadet
>            Priority: Critical
>         Attachments: qpid-dotnet.patch
>
>
> UUID.randomUUID is not thread-safe because it's using a static random object.
> However, recreating a random object each time the method is called is not an option because 2 successive calls might result in the same UUID.
> Please find attached in the next comment a patch that fixes the issue by introducing a UUIDGenerator class. Now, to get a random UUID, you first need to instantiate a UUIDGenerator and request it through it. That way there's no need to lock in the UUID class.
> Please note that this patch is BREAKING COMPABILITY with previous versions of the API !
> The patch is also fixing 2 others issues : 
> - test.config is not included in the unit test project which result in half of the unit tests failing 
> - the management console is not compiling with vs 2008 and .Net 2.0

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org