Skip to content

Commit 1371da5

Browse files
committed
Improve readability of delete and renew methods of DefaultLockRepository
1 parent 8dad15b commit 1371da5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/lock/DefaultLockRepository.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ public void close() {
392392
@Override
393393
public boolean delete(String lock) {
394394
return this.defaultTransactionTemplate.execute(
395-
transactionStatus -> this.template.update(this.deleteQuery, this.region, lock, this.id)) > 0;
395+
transactionStatus -> this.template.update(this.deleteQuery, this.region, lock, this.id)) == 1;
396396
}
397397

398398
@Override
@@ -436,7 +436,7 @@ public void deleteExpired() {
436436
public boolean renew(String lock) {
437437
final Boolean result = this.defaultTransactionTemplate.execute(
438438
transactionStatus ->
439-
this.template.update(this.renewQuery, epochMillis(), this.region, lock, this.id) > 0);
439+
this.template.update(this.renewQuery, epochMillis(), this.region, lock, this.id) == 1);
440440
return Boolean.TRUE.equals(result);
441441
}
442442

0 commit comments

Comments
 (0)