Description
Good example to create an action, with List<Entity> parameter, and remove these entities from the database in the action body. After the execution, this causes ObjectNotFoundException, because FormExecutorDefault calculates resultResponse with using snapshotArgs of ActionModel, which tries to refresh parameter, but it is deleted. JPA does not distinct detached and removed entity - stated in JpaEntityFacet - and the context treats it as detached (I think it is a good solution in JDO, entities with deleted state are ignored, but JPA sends back a detached state, even if it is deleted). A comment
"//XXX whether DETACHED or REMOVED is currently undecidable (JPA)"
warns it well, but a better solution is necessary. An acceptable solution is to catch the exception in parameter value refresh operation in EntityUtil.refetch.
Attachments
Issue Links
- is duplicated by
-
CAUSEWAY-3065 ManagedObjects.EntityUtil.refetch(...) does not handle the object-not found case well
- Resolved