File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Release resources

 
Vicky Jain
Ranch Hand
Posts: 52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello guys,

I'm having the following two questions regarding timeouts:

1) How can i release the acquired resources like database connection, handles to other resources etc, when the servelet timeouts.

2) Also how can i change the session-timeouts?

ThanQ
 
Juanjo Bazan
Ranch Hand
Posts: 231
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) How can i release the acquired resources like database connection, handles to other resources etc, when the servelet timeouts.


You can associate a HttpSessionListener. This class is in the javax.servlet.http package and it has a method sessionDestroyed.

2) Also how can i change the session-timeouts?


Do it in your deployment descriptor file:
add this to your web.xml to set the session timeout to 30 minutes:



HTH
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33694
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vicky,
Beware of holding a connection for the entire life of the session. A connection is a very expensive resource.
 
Vicky Jain
Ranch Hand
Posts: 52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks to all of you guys out here
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic