You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I'd like to be sure how to properly use the sessions/transactions of Quarkus Reactive.
I mainly do this type of process, in a Uni<> when a user call an endpoint:
Read the DB => 2. Check/Do something => 3. Write on DB the new status
More precisely, as an example:
Check a server status on DB => 2. Verify if need to change its status and operate => 3. Write the new status on DB
During step 2, I suppose the status of the server cannot change (since there's only one I/O thread).
But as stated by the Quarkus documentation, if I do some blocking operation during a reactive transaction (like reading some files, fetching data on another endpoint...), my Uni could be paused (run in worker thread), and another process could run in the I/O thread.
This situation is dangerous for my usecase because 2 different transactions could operate on the same server with a false assumption on its status.
Do I understand properly?
How should I properly manage this use case?
Thanks
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
I'd like to be sure how to properly use the sessions/transactions of Quarkus Reactive.
I mainly do this type of process, in a Uni<> when a user call an endpoint:
More precisely, as an example:
During step 2, I suppose the status of the server cannot change (since there's only one I/O thread).
But as stated by the Quarkus documentation, if I do some blocking operation during a reactive transaction (like reading some files, fetching data on another endpoint...), my Uni could be paused (run in worker thread), and another process could run in the I/O thread.
This situation is dangerous for my usecase because 2 different transactions could operate on the same server with a false assumption on its status.
Do I understand properly?
How should I properly manage this use case?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions