For a project I am working on, we devised a solution (aka hack) to solve this. A new Session interface implementation was created that wraps an internal Session object as normally provided. Yet, we added 2 methods: suspendClose() and unsuspendClose(). When closes are suspend, the connection is NOT closed despite being called. Specifically, it does not call session.close() on the internal Session object.
When a Session is retrieved, the closes are automatically suspended. The servlet filter unsuspends the close and closes the session if necessary at the end of the request.
Is this a hack? Yes. Does it work? Yes. Do we get the benefits of a ThreadLocal session? Yes. Can it be confusing to newbies who expect close to actual close the session? Yes, but it only has this behavior during deployment.
Any thoughts and comments are welcome.
Cheers, matthew
------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 _______________________________________________ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel