Hello all,
I am using spring 2.5 and hibernate 3.2 version and a view framework ZK.
My problem is associated with Lazy association fetching. I am using OpenSessionInViewFilter and configured in web.xml successfully.
I can see it working with the spring DEBUG and I see the following out put when a request is initiated :
However, I am unable to get the Lazy loading working. I get the following exception when tried to fetch a Lazy association :
The exception stack trace also shows these lines at the start :
Which shows that OpenSessionInViewFilter did get called and opened the session.
For my own debugging purpose I wrote this line of code just before the line which tries to lazy load the data :
And checked to see if SessionHolder is null, but to my surprise I did get a full object and that means that there is a session bound to
thread, then why am I getting the above exception.
I have also got the spring DEBUG logs which shows there is a session bound to the thread:
What am I doing wrong here? I simply can't get Lazy load to work, and right now I am left with nothing but to turn off Lazy loading.