-->
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: Lazy loading on remote objects
PostPosted: Tue May 24, 2005 11:08 pm 
Newbie

Joined: Tue May 24, 2005 11:01 pm
Posts: 2
We have a fat client application using hibernate as the persistence layer on the server.

The client is talking to the server throught a facade SessionBeans.

The objects are loaded by Hibernate on the server, detached from the session and sent to the client.

I'm thinking that I could use lazy loading on the objects returned to the client if I could intercept the lazy loading calls and forward them to the server.

I'm just starting with Hibernate and would appreciate any pointers on where to start with.

Thanks.
Dimitry.


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 25, 2005 11:50 am 
Senior
Senior

Joined: Sun Mar 14, 2004 10:16 am
Posts: 129
Location: Ankara
In normal conditions for remote applications, lazy loading cant work.
Since the instances that is in the session at server side and in the application at client side are not the same, lazy load will fail with an exception.
You wrote:
"Intercepting lazy load calls", I dont think that is possible with hibernate,
but on upper layer method,you can do this:

boolean loaded = false;
List list;

public List getList() {
if (!loaded) {
// Create a query to load the list from server
// Server sents you the list
// Set the returned list as this object list,
// set 'loaded' to true.
}
return list;
}

I dont think that this will add you improvement so much until this getList method is called so rarerly, go with lazy="false"

_________________
-developer


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.