On Wed, 28 Apr 2004, Ceki G�lc� wrote: | One way to achieve uniqueness across JVM instances is by marking each event | by a combination of 1) an auto incrementing id, 2) ip address of the host | 3) start time of the JVM. This combination would guarantee uniqueness with | high degree of security across JVMs.
What if two JVMs are running on the same machine? (Just pointing it out..! ;) It could be done, maybe more easily, by using some system property (e.g. jvm.unique.number), and then starting each JVM with -Djvm.unique.number=x, where x was either some specific number, or increased atomically (across the cluster of machines running JVMs) each time the script was started - or something in that direction. You could drop both the host-ip and timestamp then. Or, you could use a 512 bit long random number, maybe uuencoded (or whatever), and that would be -almost- guaranteed to be unique (that is, an -extreme- unlikelyness that two jvms would hit the same number). Drop the host-ip and timestamp here too. -- Mvh, Endre St�lsvik M[+47 93054050] F[+47 51625182] Developer @ CoreTrek AS - http://www.coretrek.com/ CoreTrek corporate portal / EIP - http://www.corelets.com/ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
