Skip to content

Commit

Permalink
Log locking issues
Browse files Browse the repository at this point in the history
  • Loading branch information
lukas-krecan committed Dec 3, 2022
1 parent 1ce0eb7 commit 08560e5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ boolean handleInsertionException(String sql, SQLException e) {
}

boolean handleUpdateException(String sql, SQLException e) {
logger.debug("Unexpected exception when updating lock record", e);
throw new LockException("Unexpected exception when locking", e);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public boolean insertRecord(@NonNull LockConfiguration lockConfiguration) {
String sql = sqlStatementsSource().getInsertStatement();
return execute(sql, lockConfiguration);
} catch (DuplicateKeyException | CannotSerializeTransactionException e) {
logger.debug("Duplicate key", e);
return false;
} catch (DataIntegrityViolationException | BadSqlGrammarException | UncategorizedSQLException | TransactionSystemException e) {
logger.error("Unexpected exception", e);
Expand All @@ -80,6 +81,7 @@ public boolean updateRecord(@NonNull LockConfiguration lockConfiguration) {
try {
return execute(sql, lockConfiguration);
} catch (CannotSerializeTransactionException e) {
logger.debug("Serialization exception", e);
return false;
} catch (DataIntegrityViolationException | TransactionSystemException e) {
logger.error("Unexpected exception", e);
Expand Down

0 comments on commit 08560e5

Please sign in to comment.