cxnStmtMgr.getNumConnectionsWithCachedStatements());
logger.log(MLevel.FINEST, "Set of statements for connection: " + cSet + (cSet != null ? "; size: " + cSet.size() : ""));
}
}
ChangeNotifyingSynchronizedIntHolder counter = new ChangeNotifyingSynchronizedIntHolder(0, true);
synchronized ( counter )
{
if (cSet != null)
{
//the removeStatement(...) removes from cSet, so we can't be iterating over cSet directly
Set stmtSet = new HashSet( cSet );
int sz = stmtSet.size();
//System.err.println("SIZE FOR CONNECTION SET: " + stmtSet.size());
for (Iterator ii = stmtSet.iterator(); ii.hasNext(); )
{
Object stmt = ii.next();
synchronized ( this )
{ removeStatement( stmt, true, counter ); }
}
try
{
while (counter.getValue() < sz)
{
//System.err.println( "counter.getValue(): " + counter.getValue() + "; sz: " + sz );
counter.wait();
}
//System.err.println( "FINAL: counter.getValue(): " + counter.getValue() + "; sz: " + sz );
}
catch (InterruptedException e)
{