--
You received this message because you are subscribed to the Google Groups "Payara Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to payara-forum...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/payara-forum/db927628-3e9b-d2b9-82bb-ffc5348b4aae%40gmail.com.
This looks like it could be a race condition whereby the step is trying to commit before the parent record has committed. As Ondrej mentioned instructions to reproduce would be good.
To view this discussion on the web, visit https://groups.google.com/d/msgid/payara-forum/602367ff.1c69fb81.7c4a1.42b3%40mx.google.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/payara-forum/602959c1.1c69fb81.57d2f.f5d0%40mx.google.com.
Yeah this will be a race condition, the outer transaction inserting the job ID is not being committed before the inner transaction inserting the step record (referencing the job ID) is committed. This could always be the case and is not a bug per-se when the step is on a different thread to the job.
To view this discussion on the web, visit https://groups.google.com/d/msgid/payara-forum/CACZTZYU3R%3Dtp0Fjb60bCR6MzwLTpiWMkG3hEWBOX9dc8nk3W%2Bg%40mail.gmail.com.
OK. I will adjust Cargo Tracker for now. Is it worth it to check
to see what the Batch specification actually expects when a job is
started within an existing managed transaction? I have to think
that is a very common scenario.
--
You received this message because you are subscribed to the Google Groups "Payara Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to payara-forum...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/payara-forum/d7da55d3-f288-4027-ad08-2a57487c8442n%40googlegroups.com.
The issue is that I really wasn't sure how Batch handled transactions. So I just put a transaction around the whole job just in case. Semantically, the expectation was that the entire batch process run would be atomic, so if it should fail in the end unexpectedly, everything would fail and avoid some kind of weird intermediate processing state.
That said, it is definitely worth revisiting the code. I don't
remember exactly what the processing intent was now and there is
file I/O involved too. Maybe atomicity in this case does not
matter at the job level so an umbrella transaction is really not
appropriate.
All this aside, of course there is the question whether that implicit EJB assumption that everything should be transactional by default is really correct.
I'll keep you posted here as to what I wind up doing with the
code, even if temporarily.
To view this discussion on the web, visit https://groups.google.com/d/msgid/payara-forum/a3b6138a-3846-47b7-bbba-b947c220366cn%40googlegroups.com.
Every chunk is processed in a global Jakarta EE transaction. If the processing of one item in the chunk fails, the transaction is rolled back and no processed items from this chunk are stored.
To view this discussion on the web, visit https://groups.google.com/d/msgid/payara-forum/f523e5b0-e86b-e9ba-3b2c-cb5bbdea762e%40gmail.com.