-->
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.  [ 4 posts ] 
Author Message
 Post subject: Quick Session EJB + Hibernate questions
PostPosted: Mon Jul 05, 2004 9:45 am 
Beginner
Beginner

Joined: Wed Sep 17, 2003 10:43 am
Posts: 48
I know I have to do my homework in depth, but I would appreciate two quickies please.

a) What happens when a remote session EJB business method returns an HBM POJO, that features a lazy-loaded collection (Set foos) and getFoos is called?

b) Do you think it's OK for the web layer to pass (unsaved) HBM POJOs to the session EJB layer?

Apologies if the questions raise RTFM-like answers; I'de still appreciate pointers to URLs...

Thanks,

Manos


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 05, 2004 12:02 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
a) -> Exception
b) -> Yes


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 06, 2004 7:53 am 
Beginner
Beginner

Joined: Wed Sep 17, 2003 10:43 am
Posts: 48
Thanks Michael.

Regarding lazy collections; can I implement some kind of intermediate logic that will allow the collection to remain lazy from the client side of things?

I wouldn't want to initialize them just to send the complete graph needed to the client, I'd like this to be transparent and dont mind a liitle more work to make it so. Sorry if this is somewhere in the docs but I couldn't find anything specific to remote EJBs and Hibernate...


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 06, 2004 12:00 pm 
Regular
Regular

Joined: Mon Jun 14, 2004 1:42 pm
Posts: 80
Location: Brazil
If the collection is lazy="true" it will be not loaded until someone iterate over it. If the client side iterate it will arise an exception. So you could build a code in the session bean that iterates over the collection that will need to be loaded before send it to the client.
The best part is that when the graph come back to persistence, hibernate is capable of know if the collection has changed or should be ignored.
I'm going by a similiar way, with good results.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.