swaldman / c3p0

a mature, highly concurrent JDBC Connection pooling library, with support for caching and reuse of PreparedStatements.

Home Page:http://www.mchange.com/projects/c3p0

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ComboPooledDataSource not implementing java.io.Closeable

koszta5 opened this issue · comments

ComboPooledDataSource does not implement this common interface. Is there any specific reason for that?

I understand keeping support for JDK6 not implementing AutoCloseable but closeable has been around since forever.

This really bit me badly with connection leaks. Also e.g. Springframework calls close() on all Closeable objects beans when context is shutting down

I think I thought java.io.Closeable maybe not so appropriate because of the java.io package and throws IOException. I'd considered in the 0.9.5.x series adding AutoCloseable, but ultimately left a note to defer that to the next release. So we'll add that to 0.10.0.

AutoCloseable is a Java 7 innovation, so adding that will necessitate targeting Java 7 rather than Java 6 classfiles. I think that's okay at this point. For legacy applications that really don't want to update past Java 6, the 0.9.5.x series still works, I hope what I'm up to now amounts to something of an improvement but there's little absolutely critical.

Thanks!

See a390634

See