Miklós Győrfi created ISIS-2979:
-----------------------------------

             Summary: Removing any JPA entity in an action, which is in a 
parameter value, causes ObjectNotFoundException
                 Key: ISIS-2979
                 URL: https://issues.apache.org/jira/browse/ISIS-2979
             Project: Isis
          Issue Type: Bug
          Components: Isis Core
    Affects Versions: 2.0.0-M7
            Reporter: Miklós Győrfi


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 thinks it is 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.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to