ARTEMIS-1006: JDBC should log proper warns with stack traces on SQLExceptions

This commit is contained in:
Clebert Suconic 2017-02-28 20:18:41 -05:00
parent 87d6c3500f
commit 70721dcd5c
1 changed files with 4 additions and 0 deletions

View File

@ -198,6 +198,7 @@ public class JDBCJournalImpl extends AbstractJDBCDriver implements Journal {
}
}
} catch (SQLException e) {
logger.warn(e.getMessage(), e);
executeCallbacks(recordRef, success);
return 0;
}
@ -212,6 +213,7 @@ public class JDBCJournalImpl extends AbstractJDBCDriver implements Journal {
connection.commit();
success = true;
} catch (SQLException e) {
logger.warn(e.getMessage(), e);
performRollback(recordRef);
}
@ -276,6 +278,7 @@ public class JDBCJournalImpl extends AbstractJDBCDriver implements Journal {
}
}
} catch (Exception sqlE) {
logger.warn(sqlE.getMessage(), sqlE);
ActiveMQJournalLogger.LOGGER.error("Error performing rollback", sqlE);
}
}
@ -670,6 +673,7 @@ public class JDBCJournalImpl extends AbstractJDBCDriver implements Journal {
rs.next();
count = rs.getInt(1);
} catch (SQLException e) {
logger.warn(e.getMessage(), e);
return -1;
}
return count;