[jboss-user] [EJB 3.0] - Re: Problem with lazy initialization - no session or session

A_titov82 do-not-reply at jboss.com
Tue Sep 5 02:50:17 EDT 2006

I get this exception when I try to request collection of related entities (using EJB3 relations). When I try to access from local client (session bean) everything is ok. But when I try to access from remote client I get the exception... 

Exception in thread "main" org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: my.Entity1.relatedCollection, 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:222)
  | 	at my.TestClient.main(TestClient.java:31)

Is it possible to access to the collection from remote client at all?

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

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

More information about the jboss-user mailing list