tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: how to change the url,username and password connection pooling
Date Fri, 04 Dec 2009 22:19:28 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Carsten,

On 11/2/2009 12:05 PM, Carsten Pohl wrote:
> I wrote a webapp, that is using tomcats connection pooling. I was
> wondering how I can change URL / username or password of the
> connection pool, without redeploying the webapp.
> 
> I tried the following:
> 
> 1. putting the configuration in the
> $CATALINA_BASE/conf/[enginename]/[hostname]/[webappname].xml and then
> changing the ressource entries. This works (in 6.0.18) but a redeploy
> happens. Which means, that the application is unavailable for some
> time.

This is expected behavior.

> 2. Using JMX to connect to the tomcat. Under catalina -> datasource
> -> webappname -> localhost-> javax.sql.datasource -> "jdbc/postgres"
> -> attributes  i see the URL, but when i change that, nothing
> happens.

You are only changing the "configuration", you aren't changing the
DataSource that was created using that configuration. If you want to
switch-out the DataSource in the JNDI context during runtime, you'll
have to actually create a new instance of a DataSource and stuff it into
the JNDI context. I'm not sure if Tomcat will let you do that, though.

Perhaps there is a way, using JMX, to trigger a re-load of the
DataSource configuration so that your above change actually has an
effect. I'm sorry, I don't have any experience with JMX in Tomcat (nor
anywhere else for that matter) so I can't really advise you.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAksZivAACgkQ9CaO5/Lv0PA4YQCfQwdR+U/bz/FVBYfw/Dtdaek3
lQwAn0b/bQcm2GmGS4zUXOAzX4GjBaGQ
=dtku
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message