Re: Tomcat JDBC Connection Pool Resource Name Issue

2014-03-04 Thread Daniel Mikusa
On Mar 3, 2014, at 7:04 PM, Scott Dudley  wrote:

> 
> I'm using the Tomcat JDBC connection pool on apache-tomcat-7.0.30.
> 
> My context xml resource name is as follows:
> 
>  
> 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 
> 
> 
> TEM Edge Blog 
> 
>  | LinkedIn  | Twitter 
> 
> 


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



Tomcat JDBC Connection Pool Resource Name Issue

2014-03-03 Thread Scott Dudley


I'm using the Tomcat JDBC connection pool on apache-tomcat-7.0.30.

My context xml resource name is as follows:

When running under Tomcat, calling ConnectionPool.getName() from my 
custom JdbcInterceptor returns "Tomcat Connection Pool[1-992158371]".  
Under JSE (a stand-alone main), it returns the expected value "jdbc/mypool".


Why is my resource name ignored or otherwise not used when running under 
the container?


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 



TEM Edge Blog 
 
| LinkedIn  | Twitter