See comments in DBCP-415. I think the problem is the finalizer. > On Apr 13, 2014, at 4:21 PM, sebb <seb...@gmail.com> wrote: > > I added some debug to DelegatingStatement and it appears that > isClosed() is sometimes being called from a different thread than the > one used to create the instance. > > I'm not sure why this should be, because the statements are created in > the TestConnectionPool.PoolTest.run() method and as far as I know > should not escape from there. > > The DelegatingStatement class is not thread-safe, but I don't suppose > it is supposed to be. > > [The Javadoc should make it clear either way] > > If a statement instance is being shared between threads, then this > could explain the test failures. > > Note: I checked the thread usage by saving the value of > Thread.currentThread() in the ctor, and then compared it with the > value returned at checkOpen(). About half the time it was the same > thread. > > Out of 8132 calls to checkOpen() 4012 were from a different thread. > This 4012 included 20 calls from the System finalizer > > I've no idea how this thread sharing is happening - but it does not seem > right. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > For additional commands, e-mail: dev-h...@commons.apache.org >
--------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org