You could also include the timestamp that the object was constructed. No
guarantees, of course, but less chances of collisions.

jim

----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, June 29, 2000 11:32 AM
Subject: Re: GUID - Generator for primary key


You can add the java.net.InetAddress
But of course then there is a risk left when running multiple jvm on one
machine.

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: 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".

===========================================================================
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".

Reply via email to