Closed GoogleCodeExporter closed 8 years ago
Can you give the simplest code to reproduce the problem?
Original comment by evernat@free.fr
on 8 May 2013 at 2:09
Hi there,
Thanks for quick response.
We have actually decided in the mean time two abandon c3p0 and use Tomcat
connection pool instead - and only use caching of preparedstatements in
MySQL not in the pool. We will of cause keep using javamelody :)
Sorry for the inconvenience. If you still are interested in tracking down
the possible bug here are some pointers:
The place i goes wrong is in com.mchange.v2.c3p0.stmt.GooGooStatementCache
in c3p0 v0.9.2.1
in the following method starting at line: 704:
It seems that registered statements doesn't match the statements which
should be unregistered when the maxStatements limit is met in c3p0. Are
there an inconsistency in a hashCode or equals method? The statements seems
to be stored in a Map-implementation.
public void undeathmarchStatement( Object ps )
{
assert Thread.holdsLock(GooGooStatementCache.this);
Long old = (Long) stmtsToLongs.remove( ps );
if (Debug.DEBUG && old == null)
throw new RuntimeException("Internal inconsistency: " +
"A (not new) checking-out statement is not in deathmarch.");
Object check = longsToStmts.remove( old );
if (Debug.DEBUG && old == null)
throw new RuntimeException("Internal inconsistency: " +
"A (not new) checking-out statement is not in deathmarch.");
}
Original comment by vahlst...@gmail.com
on 8 May 2013 at 8:41
The equals and hashCode methods are currently delegated from the javamelody
proxy to the underlying statement (that is some c3p0 statement or some jdbc
driver statement).
So it may depend also on what is exactly the source code of c3p0.
We may do otherwise than just delegate (such as unwrap the statement proxies
"this" and the parameter before equals), and check perf afterward.
But we are currently not that much interested in c3p0 v0.9.2.1 at the moment.
So closing as won't fix for now, if it's not a problem for you anymore.
Original comment by evernat@free.fr
on 8 May 2013 at 10:09
Thats fine :)
Thanks for replying
Den 09/05/2013 00.09 skrev <javamelody@googlecode.com>:
Original comment by vahlst...@gmail.com
on 8 May 2013 at 10:13
Original issue reported on code.google.com by
vahlst...@gmail.com
on 8 May 2013 at 1:54