On Mar 3, 2014, at 7:04 PM, Scott Dudley <sc...@telesoft.com> wrote: > > I'm using the Tomcat JDBC connection pool on apache-tomcat-7.0.30. > > My context xml resource name is as follows: > > <Resource name="jdbc/mypool" ... > > When running under Tomcat, calling ConnectionPool.getName() from my custom > JdbcInterceptor returns "Tomcat Connection Pool[1-992158371]”.
This appears to be the default name used by the pool. https://svn.apache.org/repos/asf/tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java > Under JSE (a stand-alone main), it returns the expected value "jdbc/mypool”. How are you configuring it? Did you call “setName” when configuring it? > Why is my resource name ignored or otherwise not used when running under the > container? This seems to be the default behavior for jdbc-pool. Have you tried setting the “object_name” attribute to “jdbc/mypool” on your Resource tag? Looking at the DataSourceFactory code, this seems to call “setName” with that value. https://svn.apache.org/repos/asf/tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/DataSourceFactory.java Dan > > Thanks. > > -- > > Scott Dudley | Senior Developer > > Telesoft | 1661 E. Camelback Road, Suite 300 | Phoenix, AZ 85016 > P: 602.308.1115 | F: 602.308.1300 | W: www.telesoft.com > <http://www.telesoft.com/?utm_source=signature&utm_medium=email&utm_campaign=2012> > > TEM Edge Blog > <http://www.telesoft.com/blog?utm_source=signature&utm_medium=email&utm_campaign=2012> > | LinkedIn <http://www.linkedin.com/company/telesoft-corp.> | Twitter > <http://www.twitter.com/_Telesoft> > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org