[Hibernate][JPA][Reactive] Does .withBackoff
still execute on the executor-thread?
#45849
-
Been looking for a way to make our application retry its startup HQL query, but the ways I have been trying seem to fail since i want to delay the execution by a given amount of seconds which causes a thread switch :(. So stumbled across So has this been fixed before I even give it a try? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
/cc @DavideD (hibernate-reactive), @gavinking (hibernate-reactive) |
Beta Was this translation helpful? Give feedback.
-
Are you using Hibernate classic or reactive? \CC @jponge |
Beta Was this translation helpful? Give feedback.
-
One might want to use a Vert.x context aware scheduler in such cases. The backoff needs a scheduled executor, so the rest of the execution on a retry is from a thread from this executor. |
Beta Was this translation helpful? Give feedback.
One might want to use a Vert.x context aware scheduler in such cases.
The backoff needs a scheduled executor, so the rest of the execution on a retry is from a thread from this executor.
ContextAwareScheduler
provides helpers to make sure that such executed tasks trigger a hop to the original Vert.x duplicated context. You will need to use.withExecutor(...)
to configure this.