tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rob Gregory" <>
Subject RE: Dynamic GlobalNamingResources / Shared JDBC connection pools
Date Wed, 17 Nov 2010 12:07:54 GMT
Is it possible to just store my existing collection of datasources in
some global context? 

initCtx = new InitialContext();  
Context envCtx  = (Context)initCtx.lookup("java:/comp/env");
envCtx.bind("datasource_live", objLiveDatasource);
envCtx.bind("datasource_test", objTestDatasource);

or something along those lines?


> -----Original Message-----
> From: Rob Gregory []
> Sent: 17 November 2010 11:09
> To: Tomcat Users List
> Subject: Dynamic GlobalNamingResources / Shared JDBC connection pools
> Tomcat Users,
> We are trying to migrate a web application from a single context
> containing multiple JDBC datasources to a web application deployed
> multiple contexts but without duplicating the shared datasources.
> Reading the docs at
> tml states that we should be using the GlobalNamingResources but I do
> not know how to create these dynamically as we do with the
> per-web-application JNDI contexts. The docs explain how to declare
> within the xml files but I need to create them on the fly. Could
> point me at some documentation or some hints at what I should be
> googling for. One approach I thought about was moving the datasource
> code into the shared location of Tomcat but following some posts this
> morning it doesn't sound like shared locations should be used by web
> apps. Sorry if my question is not clear and thanks for any assistance.
> Tomcat 6.0.29 under Java 1.5+
> Regards
> Rob

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message