-
1. Re: Hibernate tool - HQL query fails with LazyInitializationException
dgeraskov May 2, 2012 3:44 AM (in response to stephanie.smith)Could you please provide full stacktrace and may be some small example?
-
2. Re: Hibernate tool - HQL query fails with LazyInitializationException
dgeraskov May 2, 2012 8:47 AM (in response to dgeraskov)And which Hibernate Tools do you use? I can't reproduce this with my example.
-
3. Re: Hibernate tool - HQL query fails with LazyInitializationException
stephanie.smith May 2, 2012 9:03 AM (in response to dgeraskov)The problem is that my object does have a field that uses lazy instantiation (not eagerly fetched).
It appears the hibernate tool calls the toString() method on my object, which tries to invoke this field and thus the error.
To work around i just changed my toString for now so it doesn't access this field.
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.sas.workflow.engine.mediation.hibernate.HibProcess.subprocesses, no session or session was closed
at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:383)
at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:375)
at org.hibernate.collection.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:122)
at org.hibernate.collection.PersistentSet.size(PersistentSet.java:162)
at com.sas.workflow.engine.mediation.hibernate.HibProcess.toString(HibProcess.java:634)
at org.hibernate.eclipse.console.views.QueryPageViewer$LabelProviderImpl.getColumnText(QueryPageViewer.java:86)
-
4. Re: Hibernate tool - HQL query fails with LazyInitializationException
dgeraskov May 2, 2012 10:05 AM (in response to stephanie.smith)This probably was fixed with https://issues.jboss.org/browse/JBIDE-11343 in 3.3.0.Beta3.