• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Doubt on OpenSessionInViewFilter

 
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Guys,

I have a question regarding this filter. Actually it keeps the underlying Hibernate / JPA session open upon each request to a web component. Now say I have a jsp page where I have a list of countries and I have an entity that has country and city as fields with the city field being lazily loaded. Now when I request for the page that has the country, I issue a hql to fetch my list of countries. Now where does this concept of lazy loading come into picture when I click on a country on the screen to fetch the list of cities in a country? All I have to do is to submit a new request, start a new transaction to fetch all the details. I mean is the filter functionality only per request or can it sustain beyond? As per the specification of JSP / Servlets, the filters are done once the response is sent back to the client. I'm just thinking if that session can go beyond?? I would like to have some interesting discussions on this point here.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's implemented in a standard servlet filter--so it's per-request.

Whether or not is a good idea to use an OSiV filter is a different topic--I'm not convinced the potential performance penalties are worth the risk, but if people are paying attention it may not be that bad.
 
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the problem you want to solve?
 
reply
    Bookmark Topic Watch Topic
  • New Topic