From user-return-21496-apmail-commons-user-archive=commons.apache.org@commons.apache.org Sat Jul 12 17:20:28 2008 Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 65662 invoked from network); 12 Jul 2008 17:20:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Jul 2008 17:20:28 -0000 Received: (qmail 52790 invoked by uid 500); 12 Jul 2008 17:20:27 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 51708 invoked by uid 500); 12 Jul 2008 17:20:25 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 51697 invoked by uid 99); 12 Jul 2008 17:20:25 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 12 Jul 2008 10:20:25 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: error (athena.apache.org: local policy) Received: from [209.85.198.241] (HELO rv-out-0708.google.com) (209.85.198.241) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 12 Jul 2008 17:19:31 +0000 Received: by rv-out-0708.google.com with SMTP id k29so5235463rvb.30 for ; Sat, 12 Jul 2008 10:19:42 -0700 (PDT) Received: by 10.115.18.1 with SMTP id v1mr15743680wai.81.1215883181800; Sat, 12 Jul 2008 10:19:41 -0700 (PDT) Received: from ?192.168.1.184? ( [130.13.7.214]) by mx.google.com with ESMTPS id y11sm4340912pod.5.2008.07.12.10.19.37 (version=SSLv3 cipher=RC4-MD5); Sat, 12 Jul 2008 10:19:41 -0700 (PDT) Message-ID: <4878E7A8.1070900@gmail.com> Date: Sat, 12 Jul 2008 13:19:36 -0400 User-Agent: Thunderbird 2.0.0.14 (X11/20080421) MIME-Version: 1.0 To: Commons Users List Subject: Re: how unique is uid generated by version four generater. References: <13cb99320807080510x6be7517ek2cf6bbd0208e13c@mail.gmail.com> In-Reply-To: <13cb99320807080510x6be7517ek2cf6bbd0208e13c@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit From: Phil Steitz X-Virus-Checked: Checked by ClamAV on apache.org 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