Skip to content

Commit

Permalink
Merge pull request #47 from hs-web/fix-forupdate
Browse files Browse the repository at this point in the history
fix: 修复forUpdate无效问题
  • Loading branch information
zhou-hao authored Aug 11, 2023
2 parents cd92582 + 5c33e3e commit 8e9c254
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public Flux<T> fetch() {
.where(param.getTerms())
.orderBy(getSortOrder())
.when(param.isPaging(), query -> query.paging(param.getPageIndex(), param.getPageSize()))
.when(param.isForUpdate(), QueryOperator::forUpdate)
.fetch(eventWrapper(tableMetadata, wrapper, executorType("reactive"), type("fetch")))
.reactive())
.contextWrite(ctx->ctx.put(Logger.class,logger));
Expand All @@ -67,9 +68,11 @@ public Mono<T> fetchOne() {
.select(getSelectColumn())
.where(param.getTerms())
.orderBy(getSortOrder())
.paging(0, 1)
//.paging(0, 1)
.when(param.isForUpdate(), QueryOperator::forUpdate)
.fetch(eventWrapper(tableMetadata, wrapper, executorType("reactive"), type("fetchOne")))
.reactive())
.reactive()
.take(1))
.contextWrite(ctx-> ctx.put(Logger.class,logger))
.singleOrEmpty();
}
Expand Down

0 comments on commit 8e9c254

Please sign in to comment.