[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: 'no-select-before-insert'

jivkoto do-not-reply at jboss.com
Thu Oct 12 10:23:12 EDT 2006


The code that generates this log is from class org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractCreateCommand and more specifically in method protected void performInsert(EntityEnterpriseContext ctx) throws CreateException. Here is the snippet that is logging. 

?..
  |   catch(SQLException e)
  |   {
  |      if(exceptionProcessor != null && exceptionProcessor.isDuplicateKey(e))
  |      {
  |         log.error("Failed to create instance.", e);
  |         throw new CreateException(
  |            "Integrity constraint violation. Possibly unique key violation or invalid foreign key value."
  |         );
  |      }
  | 	?.
  |   }
log object is org.jboss.logging.Logger instance.
The only way that I find is not to log log level ERROR, which is too hard. Or just make feature request this logging to be changed from ERROR to WARN level. I am wondering why this is ERROR? Exception is thrown and it will not be left unnoticed, why explicitly logging is needed? If this is because throw new CreateException(??"); hides the original message and stack trace, this could be changed, too.

Is there anyone with good explanation?

Best Regards, jivkoto


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3977896#3977896

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3977896



More information about the jboss-user mailing list