Mendix 7.15 is out and still a known issue Known Issues In some situations, an object associated to another object cannot be committed during the execution of a before/after commit event, resulting in an error such as “Object of type ‘MyModule.MyEntity’ with guid ‘12345’ cannot be updated, as it does not exist anymore.” For example, consider two new objects A and B, wherein A (parent) is associated with B (child) and A has a before- or after-commit event. In this event, B will be changed and committed. If you then commit A, B will be marked as ‘autocommitting’. Because of this, committing B in the before- or after-commit event of A will fail, as it expects A to already exist in the database, which is not yet the case. (Tickets 59099, 59288) Workaround 1 – don’t commit (a child) in a before-commit event, as the child will already be autocommitted by Mendix. Workaround 2 – commit the child object before committing the parent object. We have lots of nested data and its frustrating when different parts of our system start losing data. We also have problems when we dont want to commit the nested entities to give the end user the option to cancel, if not committed the changes dont show. We use work arounds but it would be great to have the old functionality back. Regards, Patrick
This issue has indeed been on our radar for a while now. It's a tricky issue to fix in the sense that we do not want to break other related behaviour, that is why we had to explicitly plan fixing this (opposed to other issues that are rather straightforward to solve).
The good news is that this is scheduled to be part of 7.16.
Thank you for your patience thus far.
Hans L' hoëst
I am experiencing a similar problem to this in 7.23.7.
Any way to resolve this or any root cause for this issue?