0 Replies Latest reply on Jun 4, 2007 4:50 AM by John

    session.clear() effect to Proxy

    John Newbie


      we use the session.clear() method to avoid that the HibernateSession massive grows. With Hibernate 3.1 it works fine. After switching to Hibernate 3.2 we get the following Exception:

      org.hibernate.LazyInitializationException: could not initialize proxy - no Session at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:57)
      at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:111)
      at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:166)
      at com.xyz.hibernate.BillingItem_$$_javassist_168.getPrice(BillingItem_$$_javassist_168.java)

      Is it a bug in 3.2 or is it so correct now and the 3.1 behaviour was wrong?

      If i detach a persistent object from the session which effect has it to its proxys. In 3.1 it seems that the proxy will reattach automatically.