I'm working on a sharding solution that's portable across ORMs and databases, leveraging Spring's
AbstractRoutingDataSource. Problem is, when I use Hibernate, it breaks, but it works fine with OpenJPA & DataNucleus.
It appears that Hibernate is holding on to a connection when it shouldn't, but I've yet to track down where that's happening. If there's someone out there who knows the connection & transaction management parts of Hibernate well, they might be able to point me to the problem.
In the meantime, I've entered an issue for it at
https://hibernate.onjira.com/browse/HHH-6743There is a
sample project attached to the issue. See the issue comments for how to run & reproduce the problem.
Thanks,
Matthew