aspose file tools*
The moose likes Object Relational Mapping and the fly likes MultipleBagFetchException: cannot simultaneously fetch multiple bags. How to load 2 lists? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "MultipleBagFetchException: cannot simultaneously fetch multiple bags. How to load 2 lists?" Watch "MultipleBagFetchException: cannot simultaneously fetch multiple bags. How to load 2 lists?" New topic
Author

MultipleBagFetchException: cannot simultaneously fetch multiple bags. How to load 2 lists?

Muhammad Ramahy
Greenhorn

Joined: Jun 14, 2011
Posts: 11

I get this exception:

org.hibernate.loader.MultipleBagFetchException: cannot simultaneously fetch multiple bags

the cause as I think is that in my user bean I have the following code:


see that the messages list is eagerly loaded while the followers list is not lazy initialized.

in the dao I have this code:

to add a follower to the followers list
and
to save message in messages list
I don't know how to load 2 lists on same time and I can accept any work around if exists.
regards
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: MultipleBagFetchException: cannot simultaneously fetch multiple bags. How to load 2 lists?
 
Similar Threads
Confused with many to many,
Toplink refresh ManyToMany
Many to many self join using hibernate annotation
How do I get a UserDetails object from a Principal object?
Duplicate Row IN Hibernate Fetch