Unique Id.

Discussions

EJB programming & troubleshooting: Unique Id.

  1. Unique Id. (2 messages)

    Hi
      I want to create a unique id in my application. Currently we are using System.currentTimeMillis() for this purpose. But, we have 2 application servers running and there is a possibility that the ids generated on different machines could be same though it is rare. Is there a better way of generating a unique id?
    thanx
    Bharat

    Threaded Messages (2)

  2. Unique Id.[ Go to top ]

    Check out the high/low pattern in the Patterns section
  3. Unique Id.[ Go to top ]

    U can try using Random class under the util package for the generation of unique numbers.