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: where to close the session in a three tier app ?
PostPosted: Wed Mar 09, 2005 8:23 am 
Newbie

Joined: Fri Feb 18, 2005 9:23 am
Posts: 10
hello ,

it is a doubt about three tier app with hibernate .

Inside tha data layer i have created a HibernateSessionFactory class
that uses a thread local pattern for creating session and transactions
( adopted from hibernate in action )

also i have a UserDAO class in data layer .
inside the constructor started the transaction ..

as this is called from business layer where should be the correct place to
commit and close the transaction ..


thanks


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 09, 2005 8:42 am 
Newbie

Joined: Wed Mar 09, 2005 4:25 am
Posts: 9
Location: Hamburg, Germany
Using EJBs: let the container do the job of opening and closing transactions.
Using POJOs: You can put it your Bussiness-Layer or you put in Controller in the web-tier (e.g. in a RequestProcessor when using Struts). Or you can try a servlet filter.

Those topics are more explained in the great book Hibernate in Action


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.