Summary: | Improve validationQuery error handling | ||
---|---|---|---|
Product: | Tomcat Modules | Reporter: | Daniel Mikusa <dmikusa> |
Component: | jdbc-pool | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | minor | ||
Priority: | P2 | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Linux | ||
Attachments: | proposed interceptor |
Description
Daniel Mikusa
2011-01-26 10:29:22 UTC
hi Dan, this is a tricky one. Cause, we'd also be logging a lot of false positive. Connections that have gone stale and simply need to be reconnected. So WARN log level would not be good in that case. However, I agree that initially you would want to know that the query is invalid. Created attachment 26553 [details]
proposed interceptor
What about adding an Interceptor to do the validation? The attached interceptor would take the validation query and run it when the pool is created. If there is a problem with the query it would report just that one time. Dan If the connection to the database fails here, the interceptor will print out validationQuery has failed. and that is not correct I think the pool itself needs to do some validations upon startup 1. validation query 2. transaction isolation level 3. schema/catalog 4. default read only this is a valid bug, just needs to encompass the correct solution best Filip (In reply to comment #3) > What about adding an Interceptor to do the validation? The attached > interceptor would take the validation query and run it when the pool is > created. If there is a problem with the query it would report just that one > time. > > Dan I'll add in logging when the pool starts. Right now, if initializing the pool fails, it sends a JMX notification but doesn't log anything. looking in the code it does if (log.isDebugEnabled()) log.debug("Unable to validate object:",ignore); So that should already be taken care of |