it may not be unique across multiple machines (not jvm), but you can make
globally unique by adding the InetAddress.
excerpt from the jdk documentation:
Creates a pure identifier that is unique with respect to the host on which
it is generated. This UID is unique
under the following conditions: a) the machine takes more than one second to
reboot, and b) the machine's
clock is never set backward. In order to construct a UID that is globally
unique, simply pair a UID with an
InetAddress.
Ulf Gohde
> -----Original Message-----
> From: Tolu Agbeja [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 29, 2000 4:06 PM
> To: [EMAIL PROTECTED]
> Subject: Re: GUID - Generator for primary key
> Importance: High
>
>
> The UID in the jdk does not guarantee uniqueness across
> multiple jvm. To
> achieve this you are better off using a more complex algorithm.
>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 29, 2000 5:47 AM
> To: [EMAIL PROTECTED]
> Subject: Re: GUID - Generator for primary key
>
>
> In the jdk there is already a class for UID in the jdk. We're
> using it for
> primary keys.
>
>
> import java.rmi.server.UID;
>
> public class UUID {
> public static String getUUIDString() {
> UID id = new UID();
> return id.toString();
> }
>
> public static byte[] getUUIDBytes() {
> return getUUIDString().getBytes();
> }
>
> private UUID(){
> }
> }
>
>
> Mit freundlichen Gr��en
> With kind regards
>
> Ulf Gohde
> System Architect
> CE Computer Equipment AG Fon: +49 (0)521 9318-167
> Herforder Str. 155a Fax: +49 (0)521 9318-444
> 33609 Bielefeld E-Mail:[EMAIL PROTECTED]
> Germany http://www.ce-ag.com
>
>
> > -----Original Message-----
> > From: Ring, Harald [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, June 28, 2000 10:57 AM
> > To: [EMAIL PROTECTED]
> > Subject: GUID - Generator for primary key
> >
> >
> > Hi all,
> > can anyone tell me where I can get a generator for GUIDs (of
> > course written
> > in Java) which produces unique identifiers which are suitable
> > as PK for
> > EJBs?
> >
> > Thanks a lot H.Ring
> >
> > ==============================================================
> > =============
> > To unsubscribe, send email to [EMAIL PROTECTED] and
> > include in the body
> > of the message "signoff EJB-INTEREST". For general help,
> > send email to
> > [EMAIL PROTECTED] and include in the body of the message "help".
> >
>
> ==============================================================
> =============
> To unsubscribe, send email to [EMAIL PROTECTED] and
> include in the body
> of the message "signoff EJB-INTEREST". For general help,
> send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>
> ==============================================================
> =============
> To unsubscribe, send email to [EMAIL PROTECTED] and
> include in the body
> of the message "signoff EJB-INTEREST". For general help,
> send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".