hibernate/hibernate-orm — pull request #670 by tjoneslo (2014-02-04 16:38:15+00:00)
Title: Fix HHH-8930 - rebuildSessionFactory leaking resources

Make the rebuildSessionFactory() method be more aggressive about closing
everything. Particularly calling serviceRegistry.destroy(), which
releases all of the pool connections upon failure. Otherwise they're
left hanging around to cause problems on the server.