movie user wrote:
Hello Everyone,
I have a question on the common pool.
I have a makeObject() method inside the factory class. Now if this method
throws any exception do I need to do pool.invalidateObject() in the catch
block.
If I understand your question correctly, the answer is no. If your
factory's makeObject throws an exception, the pool method (borrow or
add) that invokes the factory method will not catch the exception and no
object will be added to the pool, so there is nothing to invalidate.
Phil
e.g
try {
pool.borrowObject()l
}
catch (Exception e) {
pool.invalidateObject();
}
Factory class
public Object makeObject() throws Exception {
try {
} catch (Exception e) {
throw e;
}
return <some object>
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]