-->
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.  [ 4 posts ] 
Author Message
 Post subject: Question about release resource after servlet response
PostPosted: Wed Aug 31, 2005 1:13 am 
Newbie

Joined: Sat Aug 20, 2005 5:14 am
Posts: 9
I want to close a session after the servlet finish sending the response to the client. What is the best way to do?

I am now using a ServletFilter to wrap around all servlet. Is there any better way?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 31, 2005 2:24 am 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
For unmanaged environments, everyone is pretty much using a call to Session.close in Filter.doFilter - see http://hibernate.org/43.html .


Top
 Profile  
 
 Post subject: Is there a better way - it depends
PostPosted: Wed Aug 31, 2005 2:29 am 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
I would say that managing H Session from Filter is OK.

There is some overview of various strategies:
http://www.hibernate.org/168.html

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 31, 2005 8:42 am 
Newbie

Joined: Sat Aug 20, 2005 5:14 am
Posts: 9
Yes, these article confirm that this is a proper approach...

Just wonder what if the servlet container does not support filter. Like Websphere 4.

Anyway, it is more a matter of... Why don't ask the client to use Tomcat5...

thx anyway


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