Andi Huber created CAUSEWAY-3944:
------------------------------------

             Summary: [JPA] Collection Mementos may taint Owner Entity State
                 Key: CAUSEWAY-3944
                 URL: https://issues.apache.org/jira/browse/CAUSEWAY-3944
             Project: Causeway
          Issue Type: Bug
          Components: Persistence JPA
            Reporter: Andi Huber
            Assignee: Andi Huber
             Fix For: 4.0.0


Given entity A having one-to-many relation with B declared by a collection 
field C. 

C might be used to provide a multi-valued input for one of A's actions, D say. 
For this to work we create a table memento of C's content. However, action D 
may itself modify e.g. delete the content of C., which leads to the following 
issue:

The table memento of C and the actual persisted state do no longer agree. 
Unfortunately in this case, the memento state overrules the DB state. 
Consequently the end-users gets presented a state of C that is not accurate.

I don't know how to best fix this yet, but one hot-fix that seems to work is 
that on internal action invocation, once we are inside a transaction, do a 
refresh of entity A, before it gets handed down to actions.

 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to