tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anurag Kapur <anuragka...@gmail.com>
Subject Data Source Resource Declaration in Tomcat Context
Date Wed, 09 Dec 2009 17:13:35 GMT
Tomcat version: 5.5.27
Java version: 1.5.0_14-b03

I have a datasource configured in global context (via present in
[tomcat_home]/conf/context.xml) as follows:

<Context>

Resource name=*"@tomcat.context.ece.read.ds.resource@"* auth=*"Container"
type="@tomcat.context.driver.type@" driverClassName=
"@tomcat.context.driver.class@" url="@tomcat.context.db.url@"
connectionProperties=
"{ValidateConnection=@tomcat.context.validate.connection@
,ConnectionWaitTimeout=@tomcat.context.connection.wait.timeout@}" username=
"@tomcat.context.db.user@" password="@tomcat.context.db.password@"
validationQuery="@tomcat.context.validation.query@" initialSize=
"@tomcat.context.initial.size@" minIdle="@tomcat.context.min.idle@"
maxActive="@tomcat.context.max.active@" maxIdle="@tomcat.context.max.idle@"
  maxWait="@tomcat.context.max.wait@" removeAbandonedTimeout="60"
removeAbandoned="true" logAbandoned="true"/>*
</Context>

I know a DS defined as above is visible across all the contexts defined in
the container. What I want to know is whether the data source is created for
"each" context or is it "shared" across all the available contexts?

I need to know this because if it is duplicated and not shared and the data
source establishes say 5 connections with the DB, it would mean that the
total connections to the DB would be 5 * number of contexts defined in the
container. Thus to estimate the number of DB connections this information is
needed.

Any help appreciated.

Regards

------------------------------------------------------------------
Anurag Kapur
Associate - Technology,
Sapient Corporation.

http://www.linkedin.com/in/anuragkapur

http://www.google.com/profiles/anuragkapur
------------------------------------------------------------------

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message