Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • I was also planning for this aproach and then I read this document eclipsesource.com/blogs/2012/09/04/… And as per this source hashCode doesnt have to be unique for every object. That's where I had to lookout for other options. Commented Jan 3, 2016 at 23:17
  • @RajaAnbazhagan the chances of two hashCode()s for two Connections that are open at the same time being the same is next to zero. If you want to go overboard and make it 100% unique, do something like hashCode() + '-' + System.nanoTime(). I am able to use hashCode() as a unique id just fine when doing enterprise scale jdbc debugging in logs Commented Jan 3, 2016 at 23:51
  • Finally decided to go with the hexString of hashcode approach. Commented Jan 4, 2016 at 0:19