I have a model with two OneToMany relationships. Whenever I try and load my session, I'm getting the "org.hibernate.loader.MultipleBagFetchException: cannot simultaneously fetch multiple bags" exception. From what I've read, this should not happen if I'm using Sets, which I am. My model code is below. Any help is appreciated, - Dave
I had this problem. I believe it happens when both sides of a one to many are marked eager. Either that, or multiple classes pointing to a certain other class have multiple many associations marked as eagar. I bet if you made eagar associations lazy, the problem would go away. Any thoughts?
posted 10 years ago
Thanks for your reply, Cameron. I changed both associations in the included code from EAGER to LAZY but sadly this didn't heal the pain. Any other suggestions are appreciated, - Dave