emmanuel wrote:
It's very unlikely that there is a bug in this area, but if you can reproduce the issue in a simple minimal test case, post it to JIRA.
Hi,
I am seeing something similar, I clear the persistence context and then invoke a size operation on a 1M relationship:
Code:
em.clear();
company.getEmployees().size();
I get:
com.fineos.ta3g.test.jpatests.JPASqlAnalysis.test_1Morg.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.fineos.ta3g.test.garage.Company.employees, no session or session was closed
at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:358)
at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:350)
at org.hibernate.collection.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:97)
at org.hibernate.collection.PersistentBag.size(PersistentBag.java:225)
at com.fineos.ta3g.test.jpatests.JPASqlAnalysis.test_1M(JPASqlAnalysis.java:111)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)