• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

OpenSessionInViewFilter problem  RSS feed

 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have been using the OpenSessionInViewFilter has some time in projets. But in this project I catch this problem:

(I am using Hibernate, Spring MVC, Acegi and Sitemesh)




Has you can see, the OpenSessionInViewFilter is called in stack!


and my web.xml:




Thank-you
[ September 11, 2007: Message edited by: Luciano A. Pozzo ]
 
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure that the problem comes from the filter. Do you have a "cadastro.jsp" ? There seems to be a problem in a JSTL forEach loop in that file.
 
Luciano A. Pozzo
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Christophe,

Thank-you for the reply. So, I made some tests for detect where is the problem. And I believe that it is something wrong in my transaction control, in the business layer. For some reason it is closing the hibernate session.

How I had this conclusion, because I tried to access from the controller directly to DAO, and worked fine (did not closed the hibernate session and the lazy worked). And when I use through the business layer, I catch the org.hibernate.LazyInitializationException.

So, the question is, when the transaction control commit a transaction, I should lost the hibernate session?


Thank-you
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, I don't about this kind of problem. I've found a document on Hibernate which tells that sessions obtain with getCurrentSession will be flushed and closed when the transaction is committed. Please have a look at this page.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!