i have the following code
@Stateful
class Navigator {
@PersistenceContext (type=EXTENDED)
EntityManager em;
List userList = new ArrayList();
public void init() {
userList = em.createQuery("select u from User u").getResultList();
}
public void addUser(User u) {
userList.add(u);
}
}
Then I have another SLSB to add new Users like so:
@Stateless
class ActionBean {
@PersistenceContext
EntityManager em;
@In Navigator n;
public void addUser (User u) {
em.persist(u);
n.addUser(u);
}
}
Basically, user saved using one EntityManager (in the slsb) is added to a list
that is attached to an extended persistence context.
Is the underlying peresistence context the same ?
This seems to be working fine but wanted to endorse it from the experts.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3964422#3964422
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3964422
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user