Skip to content

Commit

Permalink
Issue helidon-io#4719 - Helidon DBClient does not trigger an Exceptio…
Browse files Browse the repository at this point in the history
…n when no sane DB connection can be obtained

Signed-off-by: Tomas Kraus <tomas.kraus@oracle.com>
  • Loading branch information
Tomas-Kraus authored and romain-grecourt committed Sep 28, 2022
1 parent 2599cc4 commit 81e6f52
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,13 @@ private Single<Long> doExecute(DbClientServiceContext dbContext,
CompletableFuture<Long> queryFuture) {

executorService().submit(() -> {
connection().thenAccept(conn -> callStatement(dbContext, conn, statementFuture, queryFuture));
connection()
.thenAccept(conn -> callStatement(dbContext, conn, statementFuture, queryFuture))
.exceptionally(t -> {
statementFuture.completeExceptionally(t);
queryFuture.completeExceptionally(t);
return null;
});
});

// the query future is reused, as it completes with the number of updated records
Expand Down

0 comments on commit 81e6f52

Please sign in to comment.