Re: [JBoss-user] Key generation by random numbers

2001-06-28 Thread Philipp Meier
On Thu, Jun 28, 2001 at 08:38:53AM -0400, Michael Bilow wrote: > On 2001-06-27 at 15:24 +0200, Philipp Meier wrote: > > > On Tue, Jun 26, 2001 at 04:14:43PM -0400, Michael Bilow wrote: > > I am not sure I understand you at all. If you mean to suggest that the > primary key could be constructed

Re: [JBoss-user] Key generation by random numbers

2001-06-28 Thread Michael Bilow
On 2001-06-27 at 15:24 +0200, Philipp Meier wrote: > On Tue, Jun 26, 2001 at 04:14:43PM -0400, Michael Bilow wrote: > > Fourth, the probability of a collision between your next randomly chosen > > number and any prior randomly chosen number is going to follow a Poisson > > distribution, which may

Re: [JBoss-user] Key generation by random numbers

2001-06-27 Thread Philipp Meier
On Tue, Jun 26, 2001 at 04:14:43PM -0400, Michael Bilow wrote: > Fourth, the probability of a collision between your next randomly chosen > number and any prior randomly chosen number is going to follow a Poisson > distribution, which may not be obvious at first. This means that the > likelihood

Re: [JBoss-user] Key generation by random numbers

2001-06-27 Thread Philipp Meier
On Tue, Jun 26, 2001 at 03:55:07PM -0400, Jim Archer wrote: > Or, you could use the facility provided by java. Check out > java.rmi.server.UID. This class makes an ID guaranteed unique for the > current VM. To use it in a clustered environmant, just prepend an IP > address (as explained int he

RE: [JBoss-user] Key generation by random numbers

2001-06-27 Thread Jim Kimball
See my other post - the reverse is is just to break the order. Jim > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]]On Behalf Of danch (Dan > Christopherson) > Sent: Tuesday, June 26, 2001 4:16 PM > To: [EMAIL PROTECTED] > Subject:

RE: [JBoss-user] Key generation by random numbers

2001-06-27 Thread Jim Kimball
great. Jim > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]]On Behalf Of Jim Archer > Sent: Tuesday, June 26, 2001 4:38 PM > To: [EMAIL PROTECTED] > Subject: RE: [JBoss-user] Key generation by random numbers > > > Hi Jim... > > I&#

Re: [JBoss-user] Key generation by random numbers

2001-06-26 Thread bcd
On Tue, Jun 26, 2001 at 05:19:18PM -0400, Richard Kasperowski wrote: > > Yes, but that isn't really a problem because you'll just try again and > > it happens sufficiently rarely that the extra time used is > > insignificant. At least, that would be the theory. > > > But what if it's not suffici

Re: [JBoss-user] Key generation by random numbers

2001-06-26 Thread Richard Kasperowski
[EMAIL PROTECTED] wrote: > On Tue, Jun 26, 2001 at 11:06:42AM -0400, Richard Kasperowski wrote: > >>[EMAIL PROTECTED] wrote: >> >> >>>As a follow-up to the debate on how to get auto-increment primary >>>keys: >>> >>>Is it feasible to use a random number generator to generate primary >>>keys? I d

Re: [JBoss-user] Key generation by random numbers

2001-06-26 Thread danch (Dan Christopherson)
Michael Bilow wrote: > Note that Java represents time with millisecond _resolution_ which is not > at all the same thing as millisecond _accuracy_ in the real world. > > Relying upon this sort of thing has the effect of introducing a platform > dependency which could make the whole design fall o

RE: [JBoss-user] Key generation by random numbers

2001-06-26 Thread Michael Bilow
Note that Java represents time with millisecond _resolution_ which is not at all the same thing as millisecond _accuracy_ in the real world. Relying upon this sort of thing has the effect of introducing a platform dependency which could make the whole design fall over. For example, on the IBM Sy

RE: [JBoss-user] Key generation by random numbers

2001-06-26 Thread Jim Archer
m > > >> -Original Message- >> From: [EMAIL PROTECTED] >> [mailto:[EMAIL PROTECTED]]On Behalf Of >> [EMAIL PROTECTED] >> Sent: Tuesday, June 26, 2001 3:32 PM >> To: [EMAIL PROTECTED] >> Subject: Re: [JBoss-user] Key generation by random number

Re: [JBoss-user] Key generation by random numbers

2001-06-26 Thread danch (Dan Christopherson)
Jim Kimball wrote: > If you are looking for a simple unique ID generator that is also (somewhat) > evenly distributed, use a reverse timestamp. Use > System.getCurrentTimeMillis(), turn it into a string, then reverse it. Reverse it so that the LSB becomes MSB? Is that for better hash distribut

RE: [JBoss-user] Key generation by random numbers

2001-06-26 Thread Michael Bilow
Keep a couple of points in mind. First of all, since you are using MD5 as what amounts to a random number generator rather than for a cryptographic purpose, you may be undertaking more processing than would be required to do this in a more straightforward manner. This is because crypto hashes ar

Re: [JBoss-user] Key generation by random numbers

2001-06-26 Thread Jim Archer
Or, you could use the facility provided by java. Check out java.rmi.server.UID. This class makes an ID guaranteed unique for the current VM. To use it in a clustered environmant, just prepend an IP address (as explained int he javadoc). Jim --On Tuesday, June 26, 2001 3:43 PM -0400 Allen fogl

RE: [JBoss-user] Key generation by random numbers

2001-06-26 Thread Jim Kimball
routine to do the reversing of a long without using the generic String methods. Jim > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]]On Behalf Of > [EMAIL PROTECTED] > Sent: Tuesday, June 26, 2001 3:32 PM > To: [EMAIL PROTECTED] > Subject:

Re: [JBoss-user] Key generation by random numbers

2001-06-26 Thread danch (Dan Christopherson)
[EMAIL PROTECTED] wrote: > > Yes, but that isn't really a problem because you'll just try again and > it happens sufficiently rarely that the extra time used is > insignificant. At least, that would be the theory. Hmm. Another theory might be that if you run your head into a brick wall often

Re: [JBoss-user] Key generation by random numbers

2001-06-26 Thread Allen fogleson
6, 2001 9:28 AM Subject: RE: [JBoss-user] Key generation by random numbers > Well... I use similar technique for generating unique IDs, but I utilize the > MD5 hash function. It is believed that it provides enough uniqueness. The > only problem is that you cannot use the long as pri

Re: [JBoss-user] Key generation by random numbers

2001-06-26 Thread Allen fogleson
I guess it is feasible. you will have some hits eventually, especially if the same pool of random numbers is used accross many tables. There are several primary key generators available for free that create unique ID's for you, i would suggest using one of those. Al - Original Message -

Re: [JBoss-user] Key generation by random numbers

2001-06-26 Thread bcd
On Tue, Jun 26, 2001 at 11:06:42AM -0400, Richard Kasperowski wrote: > [EMAIL PROTECTED] wrote: > > > As a follow-up to the debate on how to get auto-increment primary > > keys: > > > > Is it feasible to use a random number generator to generate primary > > keys? I don't really need my records t

RE: [JBoss-user] Key generation by random numbers

2001-06-26 Thread Marek Sedliak
; Subject: Re: [JBoss-user] Key generation by random numbers > > > [EMAIL PROTECTED] wrote: > > > As a follow-up to the debate on how to get auto-increment primary > > keys: > > > > Is it feasible to use a random number generator to generate primary > > keys?

Re: [JBoss-user] Key generation by random numbers

2001-06-26 Thread Richard Kasperowski
[EMAIL PROTECTED] wrote: > As a follow-up to the debate on how to get auto-increment primary > keys: > > Is it feasible to use a random number generator to generate primary > keys? I don't really need my records to have steadily increasing keys > and my number of records will presumably be much

RE: [JBoss-user] Key generation by random numbers

2001-06-26 Thread RRokytskyy
Well... I use similar technique for generating unique IDs, but I utilize the MD5 hash function. It is believed that it provides enough uniqueness. The only problem is that you cannot use the long as primary key field (in my case I use String). But you may convert 128-bit digest into 2x64-bit longs

RE: [JBoss-user] Key generation by random numbers

2001-06-26 Thread Frank Villarreal
Check out this threaded discussion on primary-key generation for entity beans. Hope it helps! http://theserverside.com/patterns/thread.jsp?thread_id=4228 - Frank T. Villarreal, Jr. > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, June 26, 2001