You will have two problems with this strategy:
(1) You will be sharing the connection instance among multiple
clients. You will have to either synchronise around it or have a
JDBC driver that can handle a lot of simultaneously open
cursors.
(2) If the database is restarted you will have to restart the servlet
engine
Good (and freely available) connection pools clean out stale
connections
and can avoid this problem. However, it may take time to clean out
the stale connections.
-----Original Message-----
From: Alfredo [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 02, 2001 11:59 AM
To: [EMAIL PROTECTED]
Subject: Tomcat + MySQL + Connection Pooling
Hi everyone,
The question is, do I need connection pooling?
I'm using Tomcat + MySQL with a few servlets in a three tier app. I'm
wondering why I should use CP if I'm already creating the DB connection
in
the init() method of the servlets, and so it persists and is shared
along
all the instances of that servlet.
Thanks in advance for any help you can provide ( and sorry if this post
has
already been answered :-) )
________________________________________________________________________
___
To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html