On Sep 29, [EMAIL PROTECTED] quoth:
> Is java.rmi.server.UID.toString() not safe? I know it is host-specific,
> so prepending a hostname/ip/etc would be easy...
As the javadocs say, so long as you meet the conditions of the clock
never being set back and the host taking > 1 second to reboot you are safe
if you prepend a host identifier. The only question is what happens when
the clock is set back. A google search on the topic GUID UUID will
produce a number of discussions and pages describing it. There is
something to keep straight and that is CORBA defines a GUID as a 128 bit
identifier that conforms to certain constraints. That is different than
just needing a unique string.
>From the looks of it, j.r.server.UID is a good source for ID generation,
subject to the above limitations.
C=)
> Peter Jasko <[EMAIL PROTECTED]>
> 09/29/00 03:45 AM
> Please respond to jBoss
>
>
> To: jBoss <[EMAIL PROTECTED]>
> cc:
> Subject: RE: [jBoss-User] container generated primary key for CMP
>EntityEJB
>
>
>
> The host+pid+time is fine for generating the odd id or two but it isn't
> fail-safe. In particular it can run into trouble if your system clock
> resets
> or if you create 100s or 1000s of beans a second, as most system time
> functions only resolve to 1 millisecond.
>
> I prefer the safer high/low pattern.
>
> Peter
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of
> [EMAIL PROTECTED]
> Sent: Thursday, September 28, 2000 10:00 AM
> To: jBoss
> Subject: Re: [jBoss-User] container generated primary key for CMP
> EntityEJB
>
>
> On Sep 28, Tom Cook quoth:
>
> > [EMAIL PROTECTED] writes:
> > > On Sep 27, Rickard Oberg quoth:
> > >
> > > For our application where we internally create our primary keys we
> aren't
> > > using a database feature to do so.
> >
> > How do you guarantee that they are unique across server instances?
>
> A GUID algorithm that allows for free-form strings that encapsulate the
> host generated on, the process space within that host, a serial number
> within that process, the time generated and a random number for good
> measure. (And before you ask, yes the time link with the random number
> seed has been taken into account, but it really exists there just as a
> feel good factor.)
>
> The distributed nature of our application requires that our database not
> be monolithic in nature and minimize data overlap. I.e. the space of all
> object instances spans several physical systems and databases separated
> geographically.
>
> C=)
>
> --------------------------------------------------------------------------
> There are no significant bugs in our released software that any
> significant
> number of users want fixed. -Bill Gates, Focus Magazine, Oct 23, 1995
> --------------------------------------------------------------------------
> Caskey <caskey*technocage.com> /// TechnoCage Inc.
> --------------------------------------------------------------------------
> "Welcome to the slippery slope, here is your handbasket.
> ...say, can you work 70 hours this week?"
>
>
>
> --
> --------------------------------------------------------------
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> Problems?: [EMAIL PROTECTED]
>
>
>
> --
> --------------------------------------------------------------
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> Problems?: [EMAIL PROTECTED]
>
>
>
>
>
> --
> --------------------------------------------------------------
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> Problems?: [EMAIL PROTECTED]
>
>
--------------------------------------------------------------------------
There are no significant bugs in our released software that any significant
number of users want fixed. -Bill Gates, Focus Magazine, Oct 23, 1995
--------------------------------------------------------------------------
Caskey <caskey*technocage.com> /// TechnoCage Inc.
--------------------------------------------------------------------------
"Welcome to the slippery slope, here is your handbasket.
...say, can you work 70 hours this week?"
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]