From 82c1323d8ad207a65bcec3328fe819b228edaac7 Mon Sep 17 00:00:00 2001 From: Martin Kouba Date: Thu, 12 Oct 2023 10:14:18 +0200 Subject: [PATCH] Hibernate Reactive Panache: improve error message - when no current reactive session is found - resolves #36236 --- .../reactive/panache/common/runtime/SessionOperations.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/extensions/panache/hibernate-reactive-panache-common/runtime/src/main/java/io/quarkus/hibernate/reactive/panache/common/runtime/SessionOperations.java b/extensions/panache/hibernate-reactive-panache-common/runtime/src/main/java/io/quarkus/hibernate/reactive/panache/common/runtime/SessionOperations.java index 6c18c85066417..5f9dcc14f1587 100644 --- a/extensions/panache/hibernate-reactive-panache-common/runtime/src/main/java/io/quarkus/hibernate/reactive/panache/common/runtime/SessionOperations.java +++ b/extensions/panache/hibernate-reactive-panache-common/runtime/src/main/java/io/quarkus/hibernate/reactive/panache/common/runtime/SessionOperations.java @@ -161,8 +161,9 @@ public static Uni getSession() { } } else { throw new IllegalStateException("No current Mutiny.Session found" - + "\n\t- no reactive session was found in the context and the context was not marked to open a new session lazily" - + "\n\t- you might need to annotate the business method with @WithSession"); + + "\n\t- no reactive session was found in the Vert.x context and the context was not marked to open a new session lazily" + + "\n\t- a session is opened automatically for JAX-RS resource methods annotated with an HTTP method (@GET, @POST, etc.); inherited annotations are not taken into account" + + "\n\t- you may need to annotate the business method with @WithSession or @WithTransaction"); } } }