Announcement Announcement Module
Collapse
No announcement yet.
Keeping Session live Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Keeping Session live

    Is there any way to keep Hibernate session live after the method call?
    I am trying to implement Pagination using Gavin King's Page class.

    But it uses scrollable resultsets and as soon as my method exists, I think the session is getting killed.

    Any hints, pointers will be appreciated

    Regards,
    Vaibhav

  • #2
    Re: Keeping Session live

    Originally posted by vaibhavpuranik
    Is there any way to keep Hibernate session live after the method call?
    I am trying to implement Pagination using Gavin King's Page class.

    But it uses scrollable resultsets and as soon as my method exists, I think the session is getting killed.

    Any hints, pointers will be appreciated

    Regards,
    Vaibhav
    it depends, in which layer you want to keep sessions open:
    1) web layer - try OpenSessionInViewFilter or interceptor.
    2) business layer - wrap you method into transaction.

    see more in this topic, look for lazyinitexception

    Comment


    • #3
      scrollable resultsets
      Besides keeping the session alive you can use DetachedCriteria to keep the result between different request (just make sure you store it somewhere).

      Comment

      Working...
      X