You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Howard Miller <me...@howardmiller.co.uk> on 2002/08/16 08:20:42 UTC

Connection pools mystery

Hi,

I am new(ish) to struts and have been looking at connection pools, JNDI, Common et 
al.

Very confused! The HOWTOs that come with (at leat) 4.1.9 give a good description 
of how to implement this but describe putting all the settings in server.xml!! That 
seems like a really bad design decision to me. The pools are to do with the individual 
application not the container. Why is this info not in the web.xml file for the given 
application? In hosted situations one may not even have access to server.xml!

I did find in this mailing list a vague reference that this had been fixed in 4.1.8, but the 
archived  message had no further explanation or any links to more information.

Am I missing something here, or is there indeed a solution. If so where is it 
documented?

Regards

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Connection pools mystery

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Fri, 16 Aug 2002, Howard Miller wrote:

> Date: Fri, 16 Aug 2002 07:20:42 +0100
> From: Howard Miller <me...@howardmiller.co.uk>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>,
>      me@howardmiller.co.uk
> To: tomcat-user@jakarta.apache.org
> Subject: Connection pools mystery
>
> Hi,
>
> I am new(ish) to struts and have been looking at connection pools, JNDI, Common et
> al.
>
> Very confused! The HOWTOs that come with (at leat) 4.1.9 give a good description
> of how to implement this but describe putting all the settings in server.xml!! That
> seems like a really bad design decision to me. The pools are to do with the individual
> application not the container. Why is this info not in the web.xml file for the given
> application? In hosted situations one may not even have access to server.xml!
>

I think you might be looking at this a little bit too narrowly.

Consider an environment where you have development, test, and production
running on different servers.  Obviously, the three environments are going
to be connected to different databases as well.  Do you ***really*** want
to tweak your web.xml file depending on which server you are deploying on?

If you really insist on not configuring database connection pools in
server.xml, you're welcome to use one of the implementations that is
configured in your webapp (including the support that Struts provides by
using the <data-source> element in struts-config.xml).  Or, you can use
Tomcat 4.1, where you can deploy the <Context> portion of server.xml with
the webapp.

Personally, I think that managing database connections (and knowing what
the database usernames and passwords are) should really be the job of the
server administrator, not the webapp developer.  But you really can do it
either way.

(Note -- I know people who host very large numbers of customers on Tomcat.
They would shudder at the thought of allowing each user to define their
own database connection parameters.  Instead, they automatically provide a
JDBC data source (under a well know JNDI resource name) to every customer
who signs up for needing a database -- but none of those customers are
allowed to sign on to the database via command line tools and screw
anything up.)

Craig


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>