Can't use panache withTransaction in bean collaborator thta connects to mongo with the reactive implementation

18 Views Asked by At

I have a quarkus app (3.7.2) with a reactive endpoint "E1" that has a collaborator "C1" annotated as ApplicationsScoped. C1 calls a mongo repository class "R1" that persists a document in the database (also annotated as ApplicationScoped). If I use the Panache.withTransaction method within the endpoint E1 it's all good, but if I use it within C1 I get the error "java.lang.IllegalStateException: state should be: ClientSession from same MongoClient". Why is that? I also tried to switch from ApplicationScoped to Singleton but nothing changed.

0

There are 0 best solutions below