-
Bug
-
Resolution: Done
-
Critical
-
4.1.0.Final
-
None
I'm seeing an issue when using Stateless EJB's with CMT.
Changes made on thread b (using an Async EJB method) are not always visible on thread a.
This issue only appears in 4.1.0.Final. The same code works fine in 4.0.0.Final
Re-creating the issue was not straight forward but I now have an Arquillian test (available in the PR) that demonstrates the issue.
I have been able to recreate the issue with the following sequence of events
1. Thread A creates session
2. Thread A creates JTA transaction
3. Thread A creates a node under /
4. Thread A saves session
5. Thread A commits JTA transaction
6. Thread A creates JTA transaction
7. Thread A creates a second node under /
8. Thread A saves session
9. Thread A commits JTA transaction
10. Thread B creates a session
11. Thread creates JTA transaction
12. Thread B updates the node
13. Thread A gets the node and does not see change as expected
14. Thread B saves the session
15. Thread B commits JTA transaction
16. Thread A gets the node again and still does not see change this is not expected.
If you do not execute steps 1-5 the issue does not appear and if you do not perfume step 13 until after Thread B saves and sessions and commits the JTA transaction you do not see the issue.