-->
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: Is there any benefit closing session in Servlet Filter?
PostPosted: Tue Aug 31, 2004 4:02 am 
Senior
Senior

Joined: Wed Dec 17, 2003 4:24 am
Posts: 188
Hi everyone:

Is there any benefit to close session in Servlet Filter? We close session after I save object to database. I don't understand why close it in servlet filter. Does someone give me some idea?

_________________
You are not alone...


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 31, 2004 4:36 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
it's closed here to "protect" you.

Only one session session should be used per business process (or unit of work). In webapp, a unit of work is a httprequest.
To prevent unclosed session (and dangerous impacts) the servlet filter automatically closes session if you forget to do it.

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
 Post subject: OK!
PostPosted: Tue Aug 31, 2004 6:12 am 
Senior
Senior

Joined: Wed Dec 17, 2003 4:24 am
Posts: 188
You are right! Thks! : )

_________________
You are not alone...


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.