quarkus-renarde
quarkus-renarde copied to clipboard
Handle exception but force a rollback
As discussed in issue 38839, if we use a try catch block and return a template then the transaction is not rollbacked. In order to force a rollback we need something like this
@Path("login")
public TemplateInstance loginPage(User user)
try {
authService.register(user);
} catch (Exception e) {
// transaction is not rollbacked
return AdminTemplate.auth(e);
}
return AdminTemplate.auth();
}