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