-
Hello, I’m using Quarkus WebSockets Next extension and I’m running into issues with transactional database operations.
I have tried using .runSubscriptionOn(Infrastructure.getDefaultWorkerPool()), but it doesn't change anything. Thank you in advance for your help. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Hello @salemsd, could you share your code, or at least a relevant code snippet? There is also |
Beta Was this translation helpful? Give feedback.
Well, I don't think it's a good idea to mix the reactive pipelines (Mutiny) together with JTA (
@Transactional
), which is inherently a blocking technology. It will be inefficient at the very least.You can annotate the WS endpoint callback method with
@io.smallrye.common.annotation.Blocking
in order to instruct Quarkus to execute the method on a worker thread. Alternatively, just copy the logic fromVertxContextSupport#executeBlocking(Callable<T>)
and wrap the invocation ofsaveMessage()
. Finally, you can also consider using Hibernate Reactive API .It seems that Quarkus REST has a specific rule for
@Transactional
: "If a method or class is annotated with jakarta.transaction.Transactional t…