jpa-spec
  1. jpa-spec
  2. JPA_SPEC-46

Explicitly allow or disallow use of Entity Manager with extended Persistence Context for CDI injection

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      CDI specification has so called producer methods, allowing to create (or retrieve) objects to be injected.

      JPA specification should explicitly state whether is it allowed for Stateful Session bean to have a producer method that returns extended EntityManager?
      For example, is this legal:

      @ConversationScoped
      @Stateful
      public class MyConversationBean {
      @PersistenceContext(type=EXTENDED)
      private EntityManager em;

      @Produces
      public EntityManager getEntityManager()

      { return em; }


      }

      This would be useful if conversation is implemented with several session beans and they all want to share a single extended EntityManager.

        Activity

        donatasc created issue -
        Hide
        ldemichiel added a comment -

        I think this is probably more an EJB issue than a JPA one, but in any case
        it is something that we should evaluate for the next release.

        Show
        ldemichiel added a comment - I think this is probably more an EJB issue than a JPA one, but in any case it is something that we should evaluate for the next release.
        ldemichiel made changes -
        Field Original Value New Value
        Assignee ldemichiel [ ldemichiel ]

          People

          • Assignee:
            ldemichiel
            Reporter:
            donatasc
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated: