if(logger != null) logger.error(msg.toString());
// throw a specific type of runtime exception for a key constraint.
if("23000".equals(stateCode) || "23505".equals(stateCode))
{
throw new KeyConstraintViolatedException(shortMsg, ex);
}
else
{
throw new PersistenceBrokerSQLException(shortMsg, ex);
}