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