I just have a comment/question to throw out there to the development group...
I've noticed that whenever I commit a stale object, there are two stack traces logged as "ERROR" level messages. One is logged from the StaleObjectStateException constructor and one from SessionImpl.execute.
It seems a bit strange to me that the stack trace would be logged in two places in addition to throwing the exception. Even if I handle the exception, the console is still filled with stack traces making it look like a catastrophic error just happened. I know I can adjust my logging settings to hide such messages, but setting SessionImpl or all of Hibernate to hide ERROR level messages worries me.
I guess my question is this: if an exception is being thrown, does a message really need to be logged with an ERROR level as well? Logging as DEBUG seems a bit more reasonable to me. How should an application gracefully handle such expected errors?
I'd appreciate any opinions or suggestions.
Thanks,
Jonathan
|