List of usage examples for org.apache.commons.pool2 PooledObject invalidate
void invalidate();
From source file:JDBCPool.dbcp.demo.sourcecode.GenericObjectPool.java
/** * Destroys a wrapped pooled object.//from w w w . j ava2s. co m * * @param toDestory The wrapped pooled object to destroy * * @throws Exception If the factory fails to destroy the pooled object * cleanly */ private void destroy(PooledObject<T> toDestory) throws Exception { toDestory.invalidate(); idleObjects.remove(toDestory); allObjects.remove(new IdentityWrapper<T>(toDestory.getObject())); try { factory.destroyObject(toDestory); } finally { destroyedCount.incrementAndGet(); createCount.decrementAndGet(); } }