Here is my scenario. I have an entity bean 'Request' that has a list of entity 
beans 'Detail'. I use the @OneToMany(cascade=ALL) annotation for the 
relationship.

I have a page where I can edit 'Request' and add 'Detail' objects to it. If I 
click 'save' then everything is saved perfectly. If I hit 'discard' then I try 
and call:entityManager.refresh(request);so that the details are reverted back 
to the database. If I don't add any 'Detail' objects, it works, but if I do add 
them and then click 'discard' I get this exception:
javax.persistence.EntityNotFoundException: No row with the given identifier 
exists
I am using
@Begin(flushMode=FlushModeType.MANUAL)
on the initial method and
@End
on the discard method.

I guess that this is because the newly created Detail objects don't exist in 
the database, but I thought that calling the refresh method would take this 
possibility into account?

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

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4037583
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to