On 18/11/2010 09:34, Rob Gregory wrote: > Thanks Chris, > > After messing around with JNDI yesterday I came to the same conclusion that > Tomcat is doing some isolation and I can understand why. I will look into the > JMX approach you suggest as I am running out of options. If That doesn't > provide a solution I think I will have to deploy our connection pool logic to > the shared 'tomcat/lib' directory where static collections will be available > to all contexts. Do you see any issues with deploying code within the lib > directory?
I'm not sure about static, but maybe you can use a LifecycleListener to configure the pool globally. Check out the Listeners defined at the start of server.xml for examples. p > Many thanks for your help > Rob > > >> -----Original Message----- >> From: Christopher Schultz [mailto:ch...@christopherschultz.net] >> Sent: 17 November 2010 16:44 >> To: Tomcat Users List >> Subject: Re: Dynamic GlobalNamingResources / Shared JDBC connection pools >> > Rob, > > On 11/17/2010 7:07 AM, Rob Gregory wrote: >>>> 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? > > The above isn't going to work because Tomcat provides webapp isolation > in the JNDI space. > > You should look into the documentation for Tomcat's JMX beans: I'm sure > there is a way to use those to create on-the-fly DataSources (really > DataSourceFactories I think) using the mbeans that Tomcat exposes. > Running under a SecurityManager may complicate that effort. > > -chris >> --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
0x62590808.asc
Description: application/pgp-keys
signature.asc
Description: OpenPGP digital signature