I'm using Jakarta commons-pool-1.5.6.jar. I have 2 different pool of the same type of object (ex : Car). Is the a way to prevent returning object to the pool?
Here's a sample:
//CarPool extends BaseObjectPool
CarPool carPoolA = new CarPool();
CarPool carPoolB = new CarPool();
carPoolB.returnObject(carPoolA.borrowObject());
I would have thought the pool would've manage its content and prevent returning an external object to it?
Any thought on this? Do I have to manage this myself?