> On many systems, the only way to guarantee a unique number is to use a
> database. I can send you a StatelessSessionBean that uses Sybase to generate
> a unique id, but if you are trying to stay generic, I would recommend you
> use a hash that is based on a random long, the timestamp the *bean was
> created*, the current timestamp, and the IP address.
>
> jim
Alternatively, we created a table that manages the UIDs for us. You request
a new ID or "block" of IDs from a StatelessSessionBean, and it consults the
table to determine what to hand you. Since IDs are in sequence, as opposed
to random, you can ask for 100 IDs in one request. The SSB simply increments
the counter by 100. This can be very efficient when compared to getting the
100 IDs one at a time. However, this is not a "Universal" UID. But then again,
neither is a hash.
tim.
===========================================================================
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".