Uploaded image for project: 'Causeway'
  1. Causeway
  2. CAUSEWAY-2979

[Duplicate] Removing any JPA entity in an action, which is in a parameter value, causes ObjectNotFoundException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 2.0.0-M7
    • 2.0.0-M8
    • Core
    • None

    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

          Activity

            People

              hobrom Andi Huber
              gyorfimi Miklós Győrfi
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: