-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Aggressively logging StaleObjectStateException errors
PostPosted: Thu May 20, 2004 1:26 pm 
Newbie

Joined: Thu May 06, 2004 2:57 pm
Posts: 7
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


Top
 Profile  
 
 Post subject:
PostPosted: Sat May 29, 2004 9:30 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Steve change that in Hibernate3

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Sat May 29, 2004 9:33 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
I changed it, in Hibernate2 CVS. The StaleObjectStateException is now logged at WARN level.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Sat May 29, 2004 9:37 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Sorry, was Christian :-)

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.