[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - LazyInitializationException with Spring/Hibernate

atlanta_al do-not-reply at jboss.com
Wed Sep 6 07:42:17 EDT 2006


After setting up all my hibernate mappings I can't get rid of the following exception:

ERROR [LazyInitializationException] could not initialize proxy - the owning Session was closed
org.hibernate.LazyInitializationException: could not initialize proxy - the owning Session was closed
	at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:60)
	at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:102)
	at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:160)
	at .......bo.AppointmentBO$$EnhancerByCGLIB$$b3086c3e_4.toString()

The application is able to fetch the records from the database but as soon as I try to iterate over the PersistentSet it throws the exception stated above.

I read on the Internet that I should use org.springframework.aop.framework.ProxyFactoryBean which takes care of HibernateSession handling.

My *.hbm.xml files do not contain lazy="true" tags. Can someone help me out?

Your help will be greatly appreciated!

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3969701#3969701

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3969701

More information about the jboss-user mailing list