Executing multiple findMap query in parallel - Thread safe ? #3591
AntoineDuComptoirDesPharmacies
started this conversation in
General
Replies: 1 comment 2 replies
-
|
As far as I remember findFuture may be removed with ebean 15. So using findMapnis totally OK and yes, this is thread safe, if you use distinct query objects (what yout example does) If you prepare a query in main thread, you always can call 'query.copy()', to get a new query object. We do these kind of async queries as our daily business. We use 'DB.backgroundExecutor()' to get a Future, by submitting callable. Things to pay attention:
|
Beta Was this translation helpful? Give feedback.
2 replies
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.
-
Hi everyone,
Our objective is to run two query in parallel but we want the result being keyed in a
Map.We could have used
findFutureListbut it means doing theMapourselves.So we are wondering if it is safe to call multiple
QueryBeanfindMapmethod in parallel, without concurrency problems ?For example :
We are affraid of any random issue with shared objects during the query preparation/run.
Thanks in advance for your help.
Yours faithfully,
LCDP
Beta Was this translation helpful? Give feedback.
All reactions