Skip to content

Commit

Permalink
Always check if lock is held by current process. (#229)
Browse files Browse the repository at this point in the history
  • Loading branch information
marshall-lamb authored Nov 15, 2023
1 parent 98ca9ca commit c042d2b
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,8 @@ public boolean isDatabaseChangeLogLockTableInitialized(final boolean tableJustCr
}

private boolean isLocked(Executor executor) throws DatabaseException {
return executor.queryForInt(
new RawSqlStatement("SELECT COUNT(*) FROM " + getChangeLogLockTableName() + " where " +
"locked = TRUE ALLOW FILTERING")
) > 0;
// Check to see if current process holds the lock each time
return isLockedByCurrentInstance(executor);
}

private boolean isLockedByCurrentInstance(Executor executor) throws DatabaseException {
Expand Down

0 comments on commit c042d2b

Please sign in to comment.