From b9b9b2c8014ec44fd5bd16a5a47133d804680666 Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Mon, 17 Jan 2022 09:28:50 +0100 Subject: [PATCH] [jOOQ/jOOQ#12877] Improve blocking call error message when trying to run Query.execute(), etc. with R2DBC --- jOOQ/src/main/java/org/jooq/impl/AbstractQuery.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/jOOQ/src/main/java/org/jooq/impl/AbstractQuery.java b/jOOQ/src/main/java/org/jooq/impl/AbstractQuery.java index ad4a798486..089e6e23cb 100644 --- a/jOOQ/src/main/java/org/jooq/impl/AbstractQuery.java +++ b/jOOQ/src/main/java/org/jooq/impl/AbstractQuery.java @@ -296,7 +296,12 @@ abstract class AbstractQuery extends AbstractAttachableQueryPa if (ctx.configuration().connectionFactory() instanceof NoConnectionFactory) throw new DetachedException("Cannot execute query. No JDBC Connection configured"); else - throw new DetachedException("Attempt to execute a blocking method (e.g. Query.execute() or ResultQuery.fetch()) when only an R2BDC ConnectionFactory was configured"); + throw new DetachedException( + "Attempt to execute a blocking method (e.g. Query.execute() or ResultQuery.fetch()) " + + "when only an R2BDC ConnectionFactory was configured. jOOQ's RowCountQuery and ResultQuery " + + "extend Publisher, which allows for reactive streams implementations to subscribe to the " + + "results of a jOOQ query. Simply embed your query in the stream, e.g. using Flux.from(query). " + + "See also: https://www.jooq.org/doc/latest/manual/sql-execution/fetching/reactive-fetching/"); listener.prepareStart(ctx); prepare(ctx);