Hi eg,
I don't see a description of @PersistenceContexts. Could we add a few
words about @PersistenceContexts to section 10.4.1?
http://www.oracle.com/technetwork/middleware/ias/toplink-jpa-annotations-096251.html
includes the following:
"
@PersistenceContexts
If you need to specify more than one @PersistenceContext, you must
specify all your persistence contexts using a single
@PersistenceContexts annotation.
"
The above link also has an example that would be nice to include:
@Stateless
@PersistenceContexts({
@PersistenceContext(name="OrderEM"),
@PersistenceContext(name="ItemEM")
})
public class OrderEntryBean implements OrderEntry {
@Resource EJBContext ctx;
public Customer getCustomer(int custID) {
EntityManager em = (EntityManager)ctx.lookup("OrderEM");
return em.find(Customer.class, custID);
}
public void enterItem(int orderID, Item newItem) {
EntityManager em = (EntityManager)ctx.lookup("ItemEM");
...
}
}