}
}
// Used only for purging the bad statements.
public void purge(Object obj) {
PreparedStatementWrapper tmpPS = (PreparedStatementWrapper) obj;
Iterator keyIterator = list.keySet().iterator();
while(keyIterator.hasNext()){
CacheObjectKey key = (CacheObjectKey)keyIterator.next();
CacheEntry entry = list.get(key);
try{
//TODO Move to a more generic Contract and invoke close()
//PreparedStatementWrapper could implement the contract instead
PreparedStatementWrapper ps = (PreparedStatementWrapper)entry.entryObj;
if(ps.equals(tmpPS)) {
//Found the entry in the cache. Remove this entry.
if(_logger.isLoggable(Level.FINEST)) {
_logger.log(Level.FINEST, "Purging an entry from cache");
}
ps.setCached(false);
ps.close();
}
}catch(SQLException e){
//ignore
}
keyIterator.remove();