btm
btm copied to clipboard
LruStatementCache is broken.
The following test fails:
PreparedStatement stmt = c.prepareStatement(DB_SELECT_SYSDATE_SQL);
assertFalse(stmt.isClosed());
stmt.close();
assertTrue(stmt.isClosed());
stmt = c.prepareStatement(DB_SELECT_SYSDATE_SQL);
assertFalse(stmt.isClosed());
The problem is that the proxies inside the LruStatementCache are never replaced, which means that once "pretendClosed = true", it remains true until the statement is evicted from the cache.