-->
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.  [ 1 post ] 
Author Message
 Post subject: A goog way to avoid lazy initialization exception in EJB3 ?
PostPosted: Thu Jun 05, 2008 1:57 pm 
Newbie

Joined: Tue Oct 24, 2006 10:50 am
Posts: 3
I use Hibernate3-based JPA and use staeless session beans for DAOs. Suppose that I have 2 tables: Category and Item (i.e. 1 category has many items and 1 item can belong to many categories).

Until now I saw 2 ways to avoid lazy initialization exception:

- @ManyToMany(fetch=FetchType.EAGER)

- using FETCH JOIN: a guy in this company even wrote a bunch of classes to help build the JQL with fetch join programmatically (it works but complicated and clumsy, IMHO).

Any solution as good as Spring's OpenEntityManagerInViewFilter (for web apps) and ... well, I don't know how Spring solves this problem for desktop apps.


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

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.