Transaction errors using non-blocking/reactive resources and jOOQ. #28633
Unanswered
jdussouillez
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Ok, so it seems to be working when using the @GET
@Path("{id}")
@Produces(MediaType.APPLICATION_JSON)
@Transactional
public Uni<Brand> get(@PathParam("id") final String id) {
return brandService.get(id)
.log()
.map(Optional::orElseThrow)
.onFailure(NoSuchElementException.class)
.transform(ex -> new BrandNotFoundException());
}
Edit: with this solution, the dev UI is telling my endpoint reactive score is only 66/100. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
We are migrating our Web API from imperative to reactive and we are facing some issues (than we can "fix" using dirty hacks) so I would like to know which is the best way to do it.
Our problem is the
@Transactional
annotation (we're using jOOQ withquarkus-jooq
module), since we migrated to reactive, the code below fails :Here's two ways of fixing it :
Remove the
@Transactional
annotationLogs :
Run the call to
BrandService::get
in the subscription on a worker threadHere, the
@Transactional
annotation works fine if we change the resource code to something like this :Logs :
Both workarounds are just hacks to make it work. Do you guys know how to handle this correctly ?
Beta Was this translation helpful? Give feedback.
All reactions