File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes EJB Lazy Loading etc.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB Lazy Loading etc.." Watch "EJB Lazy Loading etc.." New topic

EJB Lazy Loading etc..

Nicky Formosa

Joined: Mar 05, 2007
Posts: 14
Hi All,

I'm quite new to EJBs, Hibernate etc..

My issue is: I have a DTO which has a few OneToMany and ManyToMany relationships, which i have set them to Load Lazy. Using the EntityManager i want to load the Main DTO. If i try to access a relationship from the main dto i get an error stating that "".

This i could solve using the Join Fetch through HQL but my question is: is there another way of doing things or?

Also what is bothering me is the fact that manytomany relationships access via the Main DTO do not return unique results instead it reaturns a full join!!

Thanks for your time...

Best regards
Nicky Formosa

Joined: Mar 05, 2007
Posts: 14
update: the error showing was : "failed to lazily initialize a collection of role...."
I agree. Here's the link:
subject: EJB Lazy Loading etc..
It's not a secret anymore!