This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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


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
 
Have you checked out Aspose?
 
subject: MultipleBagFetchException: cannot simultaneously fetch multiple bags. How to load 2 lists?
 
It's not a secret anymore!