PDA

View Full Version : how to have Hibernate lazy loading with Spring transaction


tanmoy.chakraborty
Oct 10th, 2005, 11:46 PM
Hi,
My application is built on spring hibernate. we are using inversion of control with hibernate template and callback.

For transaction mamagement we are using spring's transaction mamagement.
but the problem we are facing is that we are not able to use hibernate lazy loading feature with spring's transaction. Evey time getting not in session exception. one remedy is to use the OpenSessionInViewFilter but for that we need to use the AOP approach for hibernate spring integration.

But we are not able to change our spring hibernate integration approach in the application from inversion control technique . Without lazy loading, our application is loading too much objects intially.

can any one suggest any other approach other than OpenSessionInViewFilter to use lazy loading with spring transaction, or is it possible to have both the inversion control approach and AOP interceptor approach simultaneously in the same application. if yes kindly suggest how to implement.

katentim
Oct 11th, 2005, 03:05 AM
See http://forum.springframework.org/showthread.php?t=18824

isaw
Dec 8th, 2005, 10:00 AM
Could someone repost the link for this as the one above doesn't work and I desperately need help with the exact same problem!

Thanks!