On Mar 13, 2013, at 3:49 AM, Dunn, Rob wrote: > Commons-dbcp 1.4 supports a validationQueryTimeout property. > The tomcat7 tomcat-jdbc connection pool > (https://urldefense.proofpoint.com/v1/url?u=http://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=8LKtd%2FtAZDTpwjGeWvVQiUwkyBqCv2FEneWpUZu8YLo%3D%0A&m=GVZLVYWRq7pdCsaexj2BhgF4WD6a2XE7cPmp2QLZqV8%3D%0A&s=88a37d5288d99be5827fb4f5996596f17c7c19d4b190a18d1cfd1f891ad3ec57) > does not support this.
Funny, I was just looking at the same thing yesterday. > Has anyone found a way to configure a validation query timeout or achieve > similar functionality to commons-dbcp-1.4 in tomcat 7's tomcat-jdbc > connection pool? I couldn't find an option, like with DBCP, to do this. My thought was to write a custom connection validator and use "validatorClassName" instead. Not the cleanest approach since I have to re-implement the validation logic, but it'll let me set the timeout. > > I note that there is a QueryTimeoutInterceptor, which appears to apply to all > query timeouts, but I'd like to have the validationQueryTimeout much shorter > than the normal query timeout. I agree with you here. A separate timeout configuration would be nice. I suppose you could subclass the QueryTimeoutInterceptor and add some logic to set different timeouts for different queries, but that seems like a hack. Dan > > Many thanks > > Rob Dunn | Senior Software Engineer - Australia | Transaction Network Services > Level 21, 300 Adelaide Street | Brisbane QLD 4000 | Australia > Office +61.7.3224.9731 | Fax +61.7.3224.1785 | Mobile +61.415.860.282 > e-mail rd...@tnsi.com<mailto:rd...@tnsi.com> | > https://urldefense.proofpoint.com/v1/url?u=http://www.tnsi.com/&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=8LKtd%2FtAZDTpwjGeWvVQiUwkyBqCv2FEneWpUZu8YLo%3D%0A&m=GVZLVYWRq7pdCsaexj2BhgF4WD6a2XE7cPmp2QLZqV8%3D%0A&s=277d8546f65feae3cfdd546d8e5e47bf727be88ce6cbeb68ffbeba36074c9012<https://urldefense.proofpoint.com/v1/url?u=http://www.tnsi.com/&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=8LKtd%2FtAZDTpwjGeWvVQiUwkyBqCv2FEneWpUZu8YLo%3D%0A&m=GVZLVYWRq7pdCsaexj2BhgF4WD6a2XE7cPmp2QLZqV8%3D%0A&s=277d8546f65feae3cfdd546d8e5e47bf727be88ce6cbeb68ffbeba36074c9012> > This message and any attachments are for the sole use of each intended > recipient and may contain copyright, confidential and/or privileged > information of Transaction Network Services Inc or its related companies > ("TNS"). Any unauthorised review, use, disclosure or distribution is > prohibited. If you are not an intended recipient, please immediately destroy > all copies of the original message and let the sender know by reply e-mail. > Unless otherwise expressly specified all views are those of the sender and > not TNS. > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org