I saw an interesting posting which suggested using System.nanoTime() to generate a unique number. I guess you could go for some complex algortihm to try to generate a truly unique random number but i feel it probably just complicates things too much - better to keep it simple.
Hello Eva, you can't ensure cookie uniqueness since cookie domain is finite. For long cookies after 2^64 + 1 cookies returned, is sure at least two of them are the same. What you can do is trying to minimize cookie repetition, or better cookie repetition per record
Start with min for a datatype and add one until you get max for a data type/ With that many values, requests literally cannot overlap - it would take a request to hang around for days if not months if not years. But this implies that your locking is good.
Anton Golovin (anton.golovin@gmail.com) SCJP, SCJD, SCBCD, SCWCD, OCEJWSD, SCEA/OCMJEA [JEE certs from Sun/Oracle]
We can walk to school together. And we can both read this tiny ad: