> I m having  a counter Ejb entity, CMP which has one field "value"- int.
> I have a getValue() remote method which increments the value=value+1, and
> returns it.
> I am callingthe ejb thru' servlet, and i call the getValue(), but when I am
> running, two clients at the SAME TIME, it gives me same count, which i don't
> want.
> How can i get unique values.
> need help........somebody pls..........

It's programming heresy, but the most reliable way to get unique
numbers is to use *random* numbers.  With even a reasonably
pseudorandom sequence and a physically based seed, your odd of ever
getting duplicate values (in a 64-bit value) are considerably lower
than the odds of your mis-coding a more deterministic (but
complicated) algorithm.

M.

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