Yes, define the connection pool in server.xml, <GlobalNamingResources> then
in context.xml define a <ContextLink> That binds the shared connection pool
to each context.



On Thursday, February 6, 2014, David Newman <dnew...@unixmonkeys.com> wrote:

> I have defined a JNDI JDBC datasource as a resource in the global
> context.xml file.  I was under the impression that what this does is to
> create a shared connection pool that is tomcat wide.  But in practice what
> seems to happen is that a new instance of that connection pool is created
> for each context that is running in the container.  For example, if I have
> 6 web applications deployed I end up with 60 connections to my database,
> assuming the default initialSize parameter of 10.
>
> Is there a way to have a single connection pool that is shared amongst
> deployed applications?
>
> In case it is relevant this is tomcat 7.0.19 using the tomcat connection
> pool.
>
> Thanks
> -Dave
>

Reply via email to