JSF 1.2 specification allows injection of an entity manager into a managed bean via the @PersistenceContext annotation (JSR 252, 开发者_StackOverflow中文版p. 5-13).
What is the semantics of such an entity manager regarding transactions and lifecycle?
Is an EAR-scoped JTA-style persistence unit supposed to work here?
@Stateless
public class YourServiceBean implements YourService {
    @PersistenceContext(unitName="YourServicePU")
    EntityManager em;
    // ...
}
This will inject an EntityManager instance that you do not have to dispose of (the container takes care of it) and is supposed to play nice with container-managed transactions.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论