Bitronix 3.0

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Bitronix 3.0

Brett Wooldridge-2

I forgot to mention, the way proxies are implemented now (both Java Proxy-based and Cglib-based), they inherently implement all interfaces and sub-interfaces of their respective proxied objects.  This means the new proxies support JDBC 3.0, JDBC 4.0 (which introduced the Wrapper interface), as well Java 7's JDBC 4.1 (which introduced the AutoClosable interface).

This means Java 7 users can now use the try-with-resources construct with Bitronix:

try (
   PreparedStatement stmt = conn.prepareStatement(...)
   stmt.setString(1, "foo");

And the stmt will be properly auto-closed at the end of the try block.

The way interfaces and sub-interfaces are collected now when creating proxies should mean that Bitronix will automatically adapt to newly introduced java.sql interfaces without a code change on our part.