-
1. Re: cache.clear inside a batch
pruivo Nov 6, 2017 6:56 AM (in response to clagio)Hi clagio,
There is bug with clear() and batching together. I opened a JIRA for the issue: [ISPN-8494] Clear is leaking transaction with Batching - JBoss Issue Tracker .
It should be fixed in the next release. For now, I advice you to move the clear outside the batching or, if you need it inside the batching, execute in another thread like:
CompletableFuture.runAsync(cache::clear).get();
Thanks for your help.
Cheers,
Pedro
-
2. Re: cache.clear inside a batch
clagio Nov 6, 2017 7:16 AM (in response to pruivo)Thanks for the suggestion and the link to the bug!
-
3. Re: cache.clear inside a batch
clagio Nov 7, 2017 7:08 AM (in response to pruivo)Hello Pedro,
What happen to the startBatch transaction in case the cache.clear executed by CompletableFuture fails?
Or what if some other actions executed in the startBatch are failing? The cache.clear will be committed anyway?
Thanks
-
4. Re: cache.clear inside a batch
pruivo Nov 8, 2017 9:02 AM (in response to clagio)Hi clagio,
The clear() is isolated from the batch. So, if it fails, it doesn't fails the batch. If another operation in batch fails, the clear() is still committed.
Note that the clear() is committed when it executes and not when the batch ends!
Cheers,
Pedro
-
5. Re: cache.clear inside a batch
clagio Nov 8, 2017 10:14 AM (in response to pruivo)Hi Pedro,
I imagined, thanks for the confirmation, but at this point is not very different from having the cache.clear outside the batch..
Thanks for your help anyway!