[jboss-user] [EJB 3.0] - Using collections of detached entities

straiver do-not-reply at jboss.com
Wed Nov 22 15:02:12 EST 2006

I'm using collections of entities with multiple agregations: class Test agregates the collection of Question objects with @OneToMany annotation and each Question object agregates the collection of Answer objects. I need to send the whole test with questions and answers to the remote client, but when it recives the test I can't get access to the colections of agregated entities 'cause LazyInitializationException . I set fetch=FetchType.EAGER  for collection of questions in class Test and it works, but when I've tried to do the same thing for answers I got

org.hibernate.HibernateException: cannot simultaneously fetch multiple bags
I'd be very glad if somebody could help me to solve this trouble

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

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

More information about the jboss-user mailing list