-->
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: Three tier and lazy loading
PostPosted: Tue Jun 19, 2007 9:43 am 
Newbie

Joined: Thu May 03, 2007 7:53 am
Posts: 15
Hello,

I am using Hibernate and EJB3 (with JBOSS AS) in three tier environment (Eclipse RCP client).

I would like to have some advice about dealing with lazy object on the client tier. I am sure expert like you have tricks about it :-)

Is DTO is out of date? Are there other solutions to have loosely coupling?


Thanks,

Regards,


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 19, 2007 9:55 am 
Senior
Senior

Joined: Tue Jun 12, 2007 4:49 pm
Posts: 127
Location: India
Lazy loading can have issues in case of an object being accessed across multiple requets, as generally a transaction is inside a request, so any objects with lazily loaded children will throw exception : LazyInitializaionException: Owning session was closed.


Regards,
Jitendra


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 19, 2007 11:29 am 
Newbie

Joined: Thu May 03, 2007 7:53 am
Posts: 15
Thank you for your reply.

To avoid lazyInitialisationException on the client tier what is the procedure to follow ?
Using DTOs ? or are there better solution to reduce coupling and maintenance costs ?

Regards,


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 19, 2007 11:34 am 
Senior
Senior

Joined: Tue Jun 12, 2007 4:49 pm
Posts: 127
Location: India
Well in our project we are planning on using entity caching in a big way as its going to be a huge clustered environment.

Depends on the size of your app, if its a small app then you can altogether skip lazy loading.

I do not have knowledge of DTO.

*Please do rate if it helps to solve your problem*

Regards,
Jitendra


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 19, 2007 3:19 pm 
Newbie

Joined: Thu May 03, 2007 7:53 am
Posts: 15
Ok.
My app is quite large. About 100 entities in a clustered environment.
So I can not skip lazy loading on the business tier but in presentation layer I think I am obliged to skip lazy object due to different VM for client environment and to avoid LazyInitializationException.

My problem is how to manage this with loosely coupling.
The problem with DTO is to duplicate POJOs (without hibernate annotations) and consequently increase effort to maintain system.


Regards,


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.