Is it possible to just store my existing collection of datasources in some global context?
I.e. 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? Thanks Rob > -----Original Message----- > From: Rob Gregory [mailto:rob.greg...@ibsolutions.com] > 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 over > multiple contexts but without duplicating the shared datasources. > Reading the docs at > http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.h > 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 them > within the xml files but I need to create them on the fly. Could anyone > 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: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org