File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes how to refresh a collection after new object is added? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "how to refresh a collection after new object is added?" Watch "how to refresh a collection after new object is added?" New topic
Author

how to refresh a collection after new object is added?

X Yang
Greenhorn

Joined: Jan 18, 2012
Posts: 2
Hi, Everyone,

I have two entity classes: Centre and User. (One Centre has many Users).

Once I add a new User into the user list of a Centre, it is not in the list retrieved by 'centre.getUserCollection()'.

I guess the object 'centre' is not properly refreshed/updated after the new user has been inserted.

If I use the EntityManager to refresh the centre, the newly added user appears in the list.

Is this the normal way to keep the centre object fresh?
X Yang
Greenhorn

Joined: Jan 18, 2012
Posts: 2
The puzzle has been solved. I should always ask the Facade for latest/fresh objects after changes.
 
 
subject: how to refresh a collection after new object is added?
 
Similar Threads
Need help in modeling user sessions using session beans.
Need a Suggession on User and Admin modeling using EJBs
How to transfer objects across servers?
How to share a user-connection between two projects
JSTL forEach