[jboss-user] [JBoss Tools] - Re: Hibernate tool - HQL query fails with LazyInitializationException

Stephanie Smith do-not-reply at jboss.com
Wed May 2 09:03:10 EDT 2012


Stephanie Smith [https://community.jboss.org/people/Stephanie.Smith] created the discussion

"Re: Hibernate tool - HQL query fails with LazyInitializationException"

To view the discussion, visit: https://community.jboss.org/message/733353#733353

--------------------------------------------------------------
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)





--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/733353#733353]

Start a new discussion in JBoss Tools at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2128]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120502/7156cad2/attachment.html 


More information about the jboss-user mailing list