> I have put already a "close database connection" method within the
> destroy() method of the servlet but it does not seem to be called by
> the webserver.

Hi,

Because You open/close database connection at the wrong place.
You should open the connection just before the transaction and
close it immediately after it. I recommend to use connection pooling.
By this way, You will always get a fresh and working connection.

This all means that database connections should be opened and closed
n JavaBeans constructors/methods.

init() for opening connection and destroy() for closing it is absolutely
the _wrong_ place for database interaction.

Also, read from the servlet specification chapters concerning
servlet lifecycle.

HTH
Kare 8^)

--
Kare Nuorteva, programmer
Satama Interactive, Henry Fordin katu 6 FIN-00150 HELSINKI
tel. +3589 680 51 396, GSM +35840 57 833 57
http://www.satama.com/

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to