It was reported on the users list: http://marc.info/?t=133780532900005&r=1&w=2 http://markmail.org/thread/26yhdl7pfhdm2dic In documentation there is example [1] on using a ResourceLink with specific value for the factory, org.apache.naming.factory.DataSourceLinkFactory. It allows to specify custom username and password while reusing connections from a global datasource pool. This feature was added per bug 49543. The problem is that there is an important bit that is lacking from the description: this feature requires support from the pool implementation for getConnection(username, password) method. - In Apache Commons DBCP pool there is no support for that method [2]. An UnsupportedOperationException will be thrown. (DBCP 1.4) - In Apache Tomcat JDBC pool support for this feature is off by default (username and password are ignored). It can be enabled by setting alternateUsernameAllowed="true". [3] [1] http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Resource_Links [2] http://commons.apache.org/dbcp/apidocs/org/apache/commons/dbcp/BasicDataSource.html#getConnection%28java.lang.String,%20java.lang.String%29 [3] http://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html
Fixed in trunk r1342503 in 7.0.x r1342511 to be in 7.0.28, in 6.0.x r1342515 to be in 6.0.36.