[weld-issues] [JBoss JIRA] Updated: (WELD-664) Support declaration of an EntityManager resource through a passivating-scoped producer method

Pete Muir (JIRA) jira-events at lists.jboss.org
Fri Sep 3 13:22:52 EDT 2010


     [ https://jira.jboss.org/browse/WELD-664?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pete Muir updated WELD-664:
---------------------------

    Fix Version/s: 1.1.0.Beta2
         Priority: Minor  (was: Major)


Will try to get this into 1.1.0.Beta2

> Support declaration of an EntityManager resource through a passivating-scoped producer method
> ---------------------------------------------------------------------------------------------
>
>                 Key: WELD-664
>                 URL: https://jira.jboss.org/browse/WELD-664
>             Project: Weld
>          Issue Type: Feature Request
>          Components: Producers (Methods, Fields and Disposers)
>    Affects Versions: 1.1.0.Beta1
>         Environment: All environments
>            Reporter: Sivakumar Thyagarajan
>            Priority: Minor
>             Fix For: 1.1.0.Beta2
>
>
> If an EntityManager resource is made available through a Producer method and the method is annotated with a passivating scope as shown below, Weld today fails
> with this error message: " WELD-000053 Producers cannot declare passivating scope and return a non-serializable class"
> --- producer method snippet ---
>     @PersistenceUnit(unitName = "UDEMpu")
>     private EntityManagerFactory emf;
>     @Produces
>     @ConversationScoped
>     @UserDatabase
>     public EntityManager create() {
>         return emf.createEntityManager();
>     }
> --- producer method snippet ---
> The current workaround is to not use a "passivating scoped" producer method  and fall back to annotating the "passivating scoped" producer field with @PersistenceContext.
> Pete's idea is to enhance the user experience for a user who expects this to work by proxying the EMF and ensuring that the createEntityManager returns a proxy that is Serializable. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the weld-issues mailing list