Sorry to take so long to reply - my darned spam filter killed a bunch of reply notifications.
Jimpo, Open Session In View =
http://www.hibernate.org/43.html
But I've come to determine since July that Spring
http://www.springframework.org is better at managing Hibernate sessions (not that it does it
better, it's that IMHO it does it a little more transparently). Spring is also
much better at helping you get to declarative transactions and has a host of other benefits. Google for Matt Raible's Spring Live chapter (#2) available for free download. Does an awesome job explaining it.
Bennini, yes, the servlet context is part of the presentation tier since it wouldn't be part of the business services below it that handle not only Http requests, but possibly also those from SOAP, RMI, EJB, etc. In my view, Struts actions ride the fence between the presentation and controller layers - it glues them together. But your business services shouldn't know squat about Http (don't make lower layers depend on upper ones). If you split your code up like this, you'll not only go a long way towards SOA, but will also be setting yourself up for transactions...
Storing a Hibernate SessionFactory (or Session) in the servlet context isn't the best idea - it's better to use a Servlet Filter to bind a Session (from a SessionFactory that's available JVM-wide) to the ThreadLocal, i.e. to the user's request object's thread. In fact, that's what OpenSessionInViewFilter does, both when implemented directly or when done through Spring's support. This binds the livespan of the SessionFactory to the JVM, and the Session to the user's request/response cycle
without it creating a code dependancy in nearly every contemporary meaning of the concept (i.e. there is a dependancy there, but it's very minor and for the most part academic).
I'll be glad to explain this if you have follow-up questions, but I'd urge you to read the references above first. Really, Spring is the way to go for Hibernate session management and declarative transactions - you can leave all the rest of its features aside and still gain a lot from it.
Scott