[JPA_SPEC-46] Explicitly allow or disallow use of Entity Manager with extended Persistence Context for CDI injection Created: 05/Feb/13  Updated: 05/Apr/13

Status: Open
Project: jpa-spec
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major
Reporter: donatasc Assignee: ldemichiel
Resolution: Unresolved Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 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.



 Comments   
Comment by ldemichiel [ 22/Feb/13 ]

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.

Generated at Sat Jan 21 13:11:55 UTC 2017 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.