You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by vijay shanker <vi...@gmail.com> on 2008/07/08 14:10:36 UTC

how unique is uid generated by version four generater.

hi gruop,

This is my first mail to the list.

I am part of a team developing a system where i have to generate uid at
three different platforms. These data should be saved in a single repository
at the server.


We are planning to use VersionFourGenerator for uid generation.


I just wanted to know how can I ensure that the UUIDs generated from three
different platforms are unique and the will not be any problem when using
this as primary key in server database.
i am in the situation to generate uid, as if should always be unique.

-- 
Regards,
Vijay Shanker

Re: how unique is uid generated by version four generater.

Posted by Phil Steitz <ph...@steitz.com>.
vijay shanker wrote:
> hi gruop,
>
> This is my first mail to the list.
>
> I am part of a team developing a system where i have to generate uid at
> three different platforms. These data should be saved in a single repository
> at the server.
>
>
> We are planning to use VersionFourGenerator for uid generation.
>
>
> I just wanted to know how can I ensure that the UUIDs generated from three
> different platforms are unique and the will not be any problem when using
> this as primary key in server database.
> i am in the situation to generate uid, as if should always be unique.
>
>   
I assume you are talking about the commons-id sandbox component.

This component has not been released, so while the code is freely 
available, it is not supported.

In answer to your specific question, there is no guarantee of uniqueness 
in the implementation in a type 4 UUID.  Probablility of collision is 
extremely low, but not impossible, as these are generated using random 
number generators.  If you can use JDK 1.5+, you should consider using 
the JDK-supplied implementation.

Phil

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org