-->
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.  [ 3 posts ] 
Author Message
 Post subject: Hibernate, Session facade and cluster
PostPosted: Sun Sep 07, 2003 11:49 am 
Newbie

Joined: Thu Aug 28, 2003 7:14 am
Posts: 18
My application is designed around Session facade(Session facade id CMT session bean) in each method user gets Hibernate session and after he is done with it(mothod) session is closed in "finally" (this includes session.flush(); session.close()).

In cluster few issues raise, how do I work with the same Hibernate session thru the transaction(which could be distributed) if one Session facade decides to call another and how do I rollback since each facade is managing its own Hibernate session.

Is there away?

Thanks.

Michael.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 07, 2003 7:32 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
This may not be a viable solution but you can avoid the clusering issue by layering your architecture. The session facade can be considered the service layer and as such the start and finish of the transaction (usually using CMT). This layer communicates only to lower layers or with hibernate directly, if you find other service layer methods are required by the current service layer then you refactor the code and move the common code into a DAO layer where both service methods now use the DAO layer services. The service layer (optionally) communicates the hibernate session through a thread local so everthing is nice and clean.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 31, 2004 12:08 am 
Newbie

Joined: Tue Mar 30, 2004 11:47 pm
Posts: 1
Location: New City, NY USA
david wrote:
The service layer (optionally) communicates the hibernate session through a thread local so everthing is nice and clean.


How about if the service layer makes a remote call to another service layer component (EJB) which resides on a different physical machine in a cluster? Will thread local still work?


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