tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: JDBC Pool - Error handling during connection creation
Date Thu, 08 Mar 2012 19:48:17 GMT
Hash: SHA1


On 3/8/12 11:55 AM, Amit wrote:
> Enabling debug level would add some extra handling
> 1. We use slf4j & logback as our logging framework & tomcat uses
> jul logging. We would have to add jul-to-slf4j.jar to direct the
> jul messages to logback. This adds a performance overhead since
> the validation code & this class would be executed frequently.
> 2. Specially adding a logger in logback.xml for this particular 
> class. We have multiple web applications which do not share the 
> logback.xml currently.
> If the exception is not ignored and thrown right where it
> occurred, the stack trace would be enough to understand the root
> cause of the issue.
> [snip]
> I do not want to handle the exception. It would just help in
understanding the root cause in secs instead of mins since there could
many reasons why establishing a connection could fail. Seeing a null
pointer exception does not help at all.

So what you're saying is that you'd rather have someone here patch
Tomcat's code, then wait for another release, then upgrade all your
production systems and then see what the exception is, rather than
just enabling debug logging?

Now who's wasting time?

> I would appreciate if someone could detail on the benefits on
> having the code the way it is currently implemented i.e. why the
> exception is ignored instead of just throwing it there right away?

The method is not declared to throw any exceptions (except the
implicit RuntimeExceptions and Errors). Changing the API isn't
something that we like to do in stable releases unless it's absolutely
necessary. Filip would have to add his opinions on whether throwing
exceptions from validate is appropriate.

IMHO, debug logging is the right way to go in general. I don't think
the validate() method should throw anything, nor do I think that the
log level should be increased from debug to something higher.

- -chris
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools -
Comment: Using GnuPG with Mozilla -


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message