-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Why can't i have more then one FetchType.EAGER in an Entity?
PostPosted: Mon Oct 08, 2007 6:36 pm 
Regular
Regular

Joined: Fri Oct 05, 2007 3:22 am
Posts: 69
I had started off my JEE5 experience using TopLink Essentials which for the most part was pretty painless. I noticed a few features that looked to be useful in the Hibernate JPA provider implementation such as @IndexColumn and I must say my painless experience has become very painful.

There has been several things that had broke when I made the switchover but the biggest is the fact that I had two @OneToMany relations which are of FetchType.EAGER. Now this is part of the JEE5 specification from what I understand so why Hibernate does not provide the correct implementation I am unsure.

That being said I am stuck with one being lazy and the accessors for this are based in a Stateless session bean. So now I am constantly getting LazyInitialization errors when this collection is being retrieved.

What is the best way to resolve this instead of being required to change my Stateless bean to Stateful which is something I shouldn't have to do.

Thanks, S.D.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 08, 2007 8:05 pm 
Regular
Regular

Joined: Fri Oct 05, 2007 3:22 am
Posts: 69
There is a good article describing exactly why you encounter this problem and several potential solutions one of which I tried and it works great!

http://www.jroller.com/eyallupu/entry/hibernate_exception_simultaneously_fetch_multiple


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.