-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Vinoth,
On 2/10/15 11:57 AM, Vinoth Raja wrote: > Environment used: - Tomcat 7.0.57 - Windows - Java 1.7 - MS SQL > 2008. > > Issue:"Given password did not match password used to create the > PooledConnection" Stack trace? - -chris > There is no change in the password from the day application went > live.But it happens when there is more request. > > Background on the logic : We have five different business > application deployed on tomcat. There is different DB instance for > each business. 5 primary DB instances and 5 secondary DB > instances. I have configured total 10 datasource in tomcat > context.xml. username/password it passed in > getConnection(username,password ) to get the connection object. I > have posted the query in stackoverflow and the recommendation was > to update the library.Not sure whether to update the higher version > library. > > > Datasource and Application Logic: > > I have configured 10 datasources like the below > > <Resource auth="Container" > driver="com.microsoft.sqlserver.jdbc.SQLServerDriver" > factory="org.apache.tomcat.dbcp.dbcp.cpdsadapter.DriverAdapterCPDS" > > name="jdbc/CDBCPDS" > type="org.apache.tomcat.dbcp.dbcp.cpdsadapter.DriverAdapterCPDS" > url="jdbc:sqlserver://10.200.100.8:1433;DatabaseName=SNECDB"/> > <Resource auth="Container" > dataSourceName="java:/comp/env/jdbc/CDBCPDS" defaultMaxActive="20" > defaultMaxIdle="5" defaultMaxWait="10000" > factory="org.apache.tomcat.dbcp.dbcp.datasources.PerUserPoolDataSourceFactory" > > logAbandoned="true" name="jdbc/CDB" removeAbandoned="true" > removeAbandonedTimeout="300" testOnBorrow="true" > testWhileIdle="true" timeBetweenEvictionRunsMillis="60000" > type="org.apache.tomcat.dbcp.dbcp.datasources.PerUserPoolDataSource" > > validationQuery="select 1"/> > > Here is the java application which retrieves the connection > object. > > try { > > dataSourceName = "jdbc/".concat(GetConfigurationDetails > .get("cmm.datasource.db2." + dnis)); userName = > GetConfigurationDetails.get("cmm.username.db2"); password = > GetConfigurationDetails.get("cmm.password.db2"); if > (objLogger.isDebugEnabled()) objLogger.debug("[" + ucid + "] > dataSourceName: " + dataSourceName); > > objDataSource = (DataSource) envContext.lookup(dataSourceName); try > { connection = objDataSource.getConnection(userName, password); } > catch (SQLException e) { objLogger.error("[" + ucid + "]" + > "SQLException in connection manager: " + e.getMessage()); } > > } catch (NamingException e) { objLogger.info("[" + ucid + "]" + > "NamingException in connection manager: " + e.getMessage()); > e.printStackTrace(); } > > Background on findings: > > - There was patch to fix "when changes his/her password, the > entire connection pool must be restarted for DBCP to recognize the > new password". It is not the case with me as there is no change in > the password. - Stack Overflow recommendation to update the > library. Not sure whether to use the library from tomcat 7.0.59 - I > have modified the Resource to have username/password details and > this issue doesn't happen. <Resource name="jdbc/SHPDB" > auth="Container" type="javax.sql.DataSource" > driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver" > url="jdbc:sqlserver://10.200.100.8:1433;DatabaseName=SHPDB" > username="user" password="Password" defaultMaxActive="20" > defaultMaxIdle="5" defaultMaxWait="10000" > > removeAbandonedTimeout="300" testOnBorrow="false" > removeAbandoned="true" logAbandoned="true"/> > > Please advice whether there is any limit on the datasources to be > configured when we set the credentials from the application.There > is no issue when I have the credentials as part of the Resource. > Please advice whether the fix is already provided or it should be > handled in different way. > > Thanks Vinoth > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: GPGTools - http://gpgtools.org iQIcBAEBCAAGBQJU2l2hAAoJEBzwKT+lPKRYca0P/RuQ2HqxkoQLZ9sU7PJrqWIS jV0WOLSpHq+IWx+HnEYWZcUaZs2nB/MfCP1L3a3vSq+uc+6zmThG/jV2yIH62VAb uiXprzepMPIm8nB3W6md/wWRBtej/GaYTlC2oMxRODpWT9EDhberWAH4hC724zpC NGHCtEv722l80zZj8FnWT9WKZGs0LPgvzI+Mo2bmU8Q4QEJPZ2RbuPiutWk51Nub kKlIwn1DIQK0Bi7HsjRpgyt4LbeSgYQyaS+q3sOKGjV3ZjnQX9JaeGbNvW3RtXl+ 09l73Qkf3uhOUP+zmGSbCBYJ2HSz3x5nKicJxWbmODuhxWk7ZUrtGkKCIxd+Wdxe 8oM8aoN4iU7TnZNxg62GQtQs25sokTml2jFbjxiaSPP2ViiuX1F/nstGGm5KjGJm XkhrOfwj+mEXvXNWXQCHpn8okvA8kx4lJKcyQhOTrE642AMIkLqiNn17RG078o/u N8G/a5KCnlmZYOurqOoi/ndCEbRXR+l3nB1jeszu2kP/MGUyMSIejEyEtsBHHKvW J3uApMK63O5dQW9F6uvvG+9RAgH3cFKBv1bXUPTjjpCnD0JFmgWsdm9rMC3Woyj0 b4H+UhD9DHqWSHqJIfe61K3K7NhcTYepER7fKwyyW2WO42MUE1VEwPiKBqM0SK7M Y69T4DBGcRbmrHkZcraf =nxph -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org