Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 3.1
Hi all
Hibernate uses log4j to do logging and at times logs messages at error level. An example is AbstractFlushingEventListener, which logs an error when it encounters a unique constraint violation.
The problem is that this logging does not take into account that the caller may be trapping and recovering from the problem, thereby printing error messages to the log "too early".
Our app has concurrent threads doing insertion and some insertions will be duplicated. We have code that catches the exception and clear the session (ie, pending updates). Unfortunately the log has already been imprinted.
For now we're upping the log level of Hibernate to FATAL but clearly it would be more desirable if the logs were never printed or at least at a much lower level.
Just my 2c.