• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Lazy Loading Headaches..

Dave Brown
Ranch Hand
Posts: 301
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please believe me I have tried and tried yet still havent a solution to lazy loading problems in my application.

I am using a JPA/Hibernate/IceFaces/Netbeans 6.5 development stack.

In my application I have included the OpenSessionInViewFilter to keep the session open throughout a request however the issue I'm having seems to be the AJAX calls that get made due to user actions after a view has been rendered. Hopefully one of you guys can point me in the right direction..

In my ManagedBean, during Init() I populate a collection of object A which is bound to a datatable. Object A has a lazy One-To-Many which I want to read when the user selects the object/row in the table. So in my row selection listener I am trying to access the collection..

This is where the lazy exception fires.. So here the session must be closed because the request finished ages ago when the page was first called..(thats my understanding)..

I have tried various URL Patterns for the filter.. wondering if that was the issue. but doesnt seem to be..

I've read briefly about phase listeners but I also read that means there will be no abilitity to use transactions which, further down the line I expect I will need..

I've heard Seam handles these things better but I'm reluctant to introduce another framework simply because I don't understand how to solve this without another framework....

Any input greatly appreciated, thanks in advance..
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic