Johan Borchers created TOMEE-4567:
-------------------------------------

             Summary: RequestScoped CDI injected entityManager is not 
RequestScoped
                 Key: TOMEE-4567
                 URL: https://issues.apache.org/jira/browse/TOMEE-4567
             Project: TomEE
          Issue Type: Bug
          Components: TomEE Core Server
    Affects Versions: 10.1.2
            Reporter: Johan Borchers
         Attachments: image-2025-12-29-13-36-21-927.png, 
image-2025-12-29-13-38-05-548.png, image-2025-12-29-13-42-26-914.png, 
image-2025-12-29-13-43-35-435.png, image-2025-12-29-13-55-50-848.png

I have an @ApplicationScoped JPA service class and an @RequestScoped CDI
MyEntityManagerProvider.
Injecting the RequestScoped MyEntityManagerProvider in the @ApplicationScoped 
JPA service class always results in the same (Jta)EntityManager via the getter 
on the MyEntityManagerProvider.
In GlassFish 7.0.25 I get for every request a unique EntityManager.
It looks as if the @RequestScoped CDI Context is not honored for the 
(Jta)EntityManager.

@RequestScoped MyEntityManagerProvider.
!image-2025-12-29-13-36-21-927.png|width=427,height=172!
 
@ApplicationScoped MessageServiceBean
!image-2025-12-29-13-38-05-548.png|width=533,height=289!

@RequestScoped MessageView Faces bean
!image-2025-12-29-13-43-35-435.png|width=505,height=471!
For every call I get the same JtaEntitymanager object.

!image-2025-12-29-13-55-50-848.png|width=380,height=240!  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to