dcsimg
Can we get instance id or similar thing
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   amit_gupta
Posted On:   Friday, June 8, 2001 02:22 AM

Hi,
I am having two instances of our Connection pool class in the different part of the application. I want that while returning back the object to the pool, the pool should only accept the object created by it only. Currently an object created by second pool can be returned to the first pool which is not acceptable. For this i have to register reference or instance id or some thing unique to the object when it is created in the pool itself and then while accepting the object back from the client(the one who requested it), pool should check whether this instance was created by it or not. What can i use for this. Is hashcode okay to register the instance of the object or any other entity i can choose.

Re: Can we get instance id or similar thing

Posted By:   Sandip_Chitale  
Posted On:   Monday, June 11, 2001 09:20 PM

The object reference should be unique within a VM. Simply use the '==' operator while checking.
About | Sitemap | Contact