Announcement Announcement Module
No announcement yet.
Support for Hibernate long sessions? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Support for Hibernate long sessions?


    Is there some support in Spring for Hibernate long-session aproach - keeping Hibernate session in HttpSession, open during multiple requests, and only doing disconnect/reconnect for each request ?
    In HibernateInAction it's even described as best aproach to applciation transactions, at least from King's point of view.


  • #2
    Currently there is no out-of-the-box support in Spring which will support a long-session approach or of you like an session-per-application-transaction pattern.

    However this is definitely an feature which would be something for the Springframework and is an omission in my opinion. There are many other Spring users who find the session-per-view pattern insufficient and awkward for large systems.

    There are more users, like myself who have written or are in the process of building an in-house solution. This shouldn't be too difificult.
    Please see also this discussion on this topic:

    The approach i'm currently taken to support the session-per-logical-transaction pattern is an interceptor which will close the session via a demarcation at the end of a logical transaction.
    Last edited by robyn; May 19th, 2006, 05:55 AM.