Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 12920 invoked from network); 9 Dec 2009 17:52:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 9 Dec 2009 17:52:18 -0000 Received: (qmail 52540 invoked by uid 500); 9 Dec 2009 17:52:14 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 52494 invoked by uid 500); 9 Dec 2009 17:52:14 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 52483 invoked by uid 99); 9 Dec 2009 17:52:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Dec 2009 17:52:14 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00,HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of anuragkapur@gmail.com designates 209.85.220.214 as permitted sender) Received: from [209.85.220.214] (HELO mail-fx0-f214.google.com) (209.85.220.214) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Dec 2009 17:52:11 +0000 Received: by fxm6 with SMTP id 6so6564840fxm.0 for ; Wed, 09 Dec 2009 09:51:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=1p4HimzIKv694PoWPeKOoNB62ILw3wQS3wsdsfIouI0=; b=khxKupafajfL6d/uRjKsOuIKavZTsmcFcL/rK+R5xV/lQuC/4ojTGwzLHds2hBnRKu UHbuVzKQ1w76XsQL/EPeOcSbgqF64U8zgucKsVfv97ehuDNL/5mjvOllswO+kSOzqX9q Nzc/rut5Yz6WZpjkZ7e91Xs5DqTXtmtt5F61A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=cpxVmHBPJWk9Hz73fXTQiZZGgdMOUGmYAXH1ggQOJZbDTFGd5wSqQlWRKS+LSn7Wsl vB0gwOpqf49uRg1/B++tUDJqEffGaKE2JjrJAoJR2y+/SumEYSkWgqhzRwquulnKGZSK phH6jNvwKxbdJF1upB5eKpAK5GU6PA2KvHv/o= MIME-Version: 1.0 Received: by 10.239.156.193 with SMTP id n1mr944202hbc.187.1260381109717; Wed, 09 Dec 2009 09:51:49 -0800 (PST) In-Reply-To: <4B1FDB65.7000303@apache.org> References: <2fb267f80912090913uba5aa4eq61a78d520003e39a@mail.gmail.com> <4B1FDB65.7000303@apache.org> Date: Wed, 9 Dec 2009 17:51:49 +0000 Message-ID: <2fb267f80912090951v5f5e81c7x6461f7e99b5e5bf9@mail.gmail.com> Subject: Re: Data Source Resource Declaration in Tomcat Context From: Anurag Kapur To: Tomcat Users List Cc: "Kapur, Anurag" Content-Type: multipart/alternative; boundary=001485f772e0538ccb047a4f586a --001485f772e0538ccb047a4f586a Content-Type: text/plain; charset=ISO-8859-1 Thanks Mark. Can you confirm that I can have one data source "shared" across all contexts with the following configurations: In CATALINA_BASE/conf/server.xml, I define a GlobalNamingResource as follows: ... ... 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"/>* I then reference it in CATALINA_BASE/conf/context.xml as follows: Information obtained from your reply and http://tomcat.apache.org/tomcat-5.5-doc/config/globalresources.html Kind Regards ------------------------------------------------------------------ Anurag Kapur Associate - Technology, Sapient Corporation. http://www.linkedin.com/in/anuragkapur http://www.google.com/profiles/anuragkapur ------------------------------------------------------------------ Sent from Poplar, Greater London, United Kingdom On Wed, Dec 9, 2009 at 5:16 PM, Mark Thomas wrote: > Anurag Kapur wrote: > > 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: > > > > > 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? > > One DS is created for each context. > > If you want a single DS, create it is a global resource and then > reference the global resource from CATALINA_BASE/conf/context.xml > > Mark > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > For additional commands, e-mail: users-help@tomcat.apache.org > > --001485f772e0538ccb047a4f586a--