The problem here is that Hibernate 4.2 exposes the actual underlying Connection now - instead of the "borrowed connection" handle that it used to return, which was a proxy that interpreted a "close()" call as returning the borrowed connection to the Hibernate Session.
I've fixed this in the course of other JPA-related changes for 4.0 M1, with HibernateJpaDialect's HibernateConnectionHandle simply not calling "close()" on a Hibernate 4.x provided Connection anymore. In contrast to Hibernate 3.6 (see
SPR-6895), Hibernate 4.1 didn't do anything special when receiving a "close()" call on a borrowed connection handle, so it should be safe to not call "close()" against Hibernate 4.x in general.
To be backported to 3.2.3. Note that we need to make sure that we're not sacrificing HibernateJpaDialect's JPA 1.0 and Hibernate 3.2-3.5 compatibility there. I would also suggest to keep 3.2.3 compiling and testing against Hibernate 4.1 since that is the primary version that it has been designed for. 4.0 M1 compiles against Hibernate 4.2 now and needs to be tested against 4.2 as well as the upcoming 4.3 (with JPA 2.1 support).