Bug Report: Two EJB Instances Without Extended Persistence Contexts Leading to Transaction Exception #6983
Labels
Status: Open
Issue has been triaged by the front-line engineers and is being worked on verification
Type: Bug
Label issue as a bug defect
Brief Summary
I am experiencing an issue while working with a REST endpoint that involves a mix of Stateful EJBs and a Singleton EJB, specifically concerning the transaction propagation and extended persistence contexts.
Throughout the entire flow from the REST endpoint to the second Stateful EJB, there is no reference to the PersistenceContext that is defined in a separate Stateful EJB. The setup involves two Stateful EJBs and one Singleton EJB, but none of these EJBs directly interact with or utilize the PersistenceContext from the EntityManagerAwareStateful EJB, which is defined alongside them.
The following exception is thrown:
Expected Outcome
I expect that when the GET method on the REST endpoint is called, the transaction is managed correctly across the EJBs, allowing for the use of the EntityManagerFactory without encountering conflicts from multiple extended persistence contexts.
Current Outcome
Instead of the expected behavior, an exception is thrown indicating that two different extended persistence contexts are detected within the same transaction. This suggests that the MyFirstStateful EJB and the MySecondStateful EJB may be creating separate contexts when they should be sharing the same one.
Reproducer
payara-issue.zip
Operating System
6.10.6-10-MANJARO
JDK Version
JDK 8 + payara 5.2020.2
Payara Distribution
Payara Server Full Profile
The text was updated successfully, but these errors were encountered: