AbstractFlushingEvent prints stack trace at ERROR priority
----------------------------------------------------------
Key: HHH-5407
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5407
Project: Hibernate Core
Issue Type: Improvement
Affects Versions: 3.5.4
Environment: MySQL 5.0.77, Hibernate 3.5.3, Java 1.6.x, Spring, ...
Reporter: Tony Jacobs
Priority: Minor
I think my application logic correctly deals with the thrown exception, so I'd like to
suppress the stack trace, but I don't want to turn off the ERROR level in a
toolkit-level library such as Hibernate. A compromise that we use all of the time at my
company is to print a one-liner error message with a hint on how to get the full stack
trace for future offenses.
We're running hibernate 3.5.3, but this diff is against an older baseline. The same
issue does still appear in hibernate-core trunk (line 324 in the trunk):
{noformat}
.../hibernate-3.2.3.ga/src/org/hibernate/event/def>diff -u
AbstractFlushingEventListener.java.orig AbstractFlushingEventListener.java
--- AbstractFlushingEventListener.java.orig 2008-07-04 13:57:05.406250000 -0400
+++ AbstractFlushingEventListener.java 2010-07-23 11:04:50.375000000 -0400
@@ -298,7 +298,8 @@
session.getActionQueue().executeActions();
}
catch (HibernateException he) {
- log.error("Could not synchronize database state with
session", he);
+ log.error("Could not synchronize database state with session
(full trace at INFO priority): " + he);
+ log.info( "Full stack trace:", he );
throw he;
}
finally {
{noformat}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira