Java Persistence with EntityManager: A Comprehensive Guide
1. Extended Persistence Context in Stateful Session Beans
In the context of stateful session beans, an extended persistence context can be used by applying the @javax.persistence.PersistenceContext annotation with a type of EXTENDED . Here is an example:
@Stateful
public class MyBean implements MyBusinessInterface
{
@PersistenceContext (unitName="nameOfMyPu", type=PersistenceContextType.EXTENDED)
private EntityManager manager;
}
When the MyBean instance is created, a persistence context is also created for the injected manager field. The lifespan of this persistence context is the s
超级会员免费看
订阅专栏 解锁全文
1239

被折叠的 条评论
为什么被折叠?



