-->
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.  [ 5 posts ] 
Author Message
 Post subject: Association Fetching and RMI
PostPosted: Tue Jun 29, 2004 8:08 am 
Beginner
Beginner

Joined: Thu May 13, 2004 5:51 am
Posts: 28
I have a RMI Client - Server architecture where I am not permitted to share the Hibernate jars on the server with the client. My problem is when I dont want to load collections/associations at all, what do I do to share the persistent beans with the Client?

If I do this:
At server:
Parent P = session.createCriteria(Parent.class).setFetchMode("children",LAZY);
session.close();
return P;

I get a un-marshalling exception at client for Hibernate Sets. The only solution for me seems to be nulling all the un-required associations before returning a persistent bean. But that defeats the purpose of not loading associations when you dont need them.

I would love to have a option with Criteria to set a fetch mode to NONE. So I never fetch a association.

Thanks for your help and attention.

--


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 29, 2004 8:38 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Hibernate has it's own collection implementation whether lazy or not. You'll need DTO to match your requirements

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 29, 2004 9:20 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Unmarshaling and Marshaling lazy-loading collections over RMI should work just fine as long as hibernate2.jar odmg.jar and cglib.jar are present on the client. I do it all the time, so I am pretty sure it works.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 29, 2004 12:01 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
michael wrote:
Unmarshaling and Marshaling lazy-loading collections over RMI should work just fine as long as hibernate2.jar odmg.jar and cglib.jar are present on the client. I do it all the time, so I am pretty sure it works.

Yes but
Quote:
I am not permitted to share the Hibernate jars on the server

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 29, 2004 5:13 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Ah, should read more closely :)


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