-->
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.  [ 1 post ] 
Author Message
 Post subject: disabling exception log
PostPosted: Wed Mar 11, 2009 7:11 am 
Newbie

Joined: Wed Mar 11, 2009 6:50 am
Posts: 1
I catched a LazyInitializationException as a workarround for a Grails issue (http://jira.codehaus.org/browse/GRAILS-2764), but the stacktrace still appeared in logs.

Looking Hibernate source code I found this little jewel:

Code:
public LazyInitializationException(String msg) {
   super(msg);
   LogFactory.getLog(LazyInitializationException.class).error(msg, this);
}


So I ended up putting this rather nasty line in the log4j config file:

Code:
log4j.logger.org.hibernate.LazyInitializationException=FATAL


Anybody knows if there are any plans or open issue in order to make Hibernate exceptions really catchable? In the mean time, is there any other workaround?


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

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.