I have a domain model like this: Company -* Department -* Employee

On a Company's page I list all Departments with their Employees. The code on 
the page (facelets) just iterates and displays the Departments and their 
Employees.

When I add or delete an Employee, the page has to be updated so I do this in 
the backing bean:

em.refresh(company);
  | departments = company.getDepartments();

This works ok when adding an Employee. But when I refresh the company after 
*deleting* an employee I get this:

javax.ejb.EJBTransactionRolledbackException: 
javax.persistence.EntityNotFoundException: org.hibernat
  | e.UnresolvableObjectException: No row with the given identifier exists: 
[com.example.Employee#231]   
  | 

Any idea why, or how to avoid this? Or maybe a different way of refreshing my 
view? Thanks.


P.S.

I also tried like this instead of refreshing the company:

departments = departmentDAO.getAll(); // straightforward em query call


No error now, but the the view isn't updated correctly after either adding or 
deleting an Employee (new Employees don't show up immediately, deleted ones 
still show).

Any help would be highly appreciated. Thanks.


View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3940640#3940640

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3940640


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to