Subject Re: [Firebird-Java] Closing FBWrappingDataSource
Author Roman Rokytskyy
> I have a test suite run inside JUnit, where I open up a series of
> connection pools (one for each test), and because the garbage
> collector could not run fast enough to close the old pool (I could
> call System.gc() a lot, but I think that's a bit inelegant) before
> the new one was up and running, there would be times that it would
> just hang on, for example, a connection commit() because, I assume,
> one connection was deleting tables that an old connection was still
> holding a reference to, like in a PreparedStatement.

Yes, in this case shutdown() makes sense.

> Doing this change, and making an explicit shutdown() call on the
> FBConnectionPoolDataSource after each test, fixed the weird hangs as
> described above, so my hypothesis was seemingly correct. I think
> having a shutdown() method in FBWrappingDataSource would be nice
> though, just for code simplicity sake. Thanks for your help!

It's already in CVS and hopefully I will release 1.5.0 version tomorrow.

> java.lang.ArithmeticException: / by zero
> at
> org.firebirdsql.pool.PooledConnectionQueue$IdleRemover.run(PooledCon
> nectionQueue.java:505)

Fixed.

Thanks!
Roman