Have a look at the Spring Framework's support for resource and transaction management. It is
exactly intended for scenarios like yours, providing means for complete abstraction from the actual data access strategy. The article at
http://www.hibernate.org/110.html discusses the relevant parts of Spring.
In a Spring-managed application, generic transactions are typically defined for service layer methods, getting automatically propagated to DAOs through the use of ThreadLocals under the covers. Hibernate Sessions are associated with those transactions through the use of the HibernateTransactionManager implementation, without the service layer code being aware of working with Hibernate.
In the upcoming release 1.0 M4, we introduce an OpenSessionInViewFilter to allow for using the "Open Session in View" pattern with Spring-managed transactions. We still recommend to close resources like Sessions before attempting to render a view, but we now offer the choice to keep the Session open until rendering completion.
Note that despite the fact that Spring provides its own web MVC framework, it can serve as middle tier backbone for other web MVC frameworks, or in fact any kind of application. We have numerous people combining Spring with the likes of Struts, WebWork2, and Tapestry; such integration is straightforward.
Juergen
(Spring Framework developer)