Hi all,

I'm helping Maik and the guys at Selbstdenker update an app from Cayenne v4.1 
to 4.2.
The application is very much based on handling and responding to lifecycle 
events and changes, but parts of it are failing after the update, seemingly due 
to a problem in CommitLogListener.
After some investigation, what I've been able to replicate is that if a related 
object is modified in at least an object's @PreUpdate phase in v4.2, the 
CommitLogListener will receive an empty ChangeMap (or at least a mutilated one).
This happens regardless of whether a related object is modified in a 
DataObject's PreUpdate callback-method (added via the model) or in a listener 
on the DataDomain that does stuff in @PreUpdate.
Note that this only happens, if you modify *a related object*, it does not 
happen if you modify an attribute on the object itself.

The problem only shows up if the CommitLogListener is registered in 
.excludeFromTransaction() mode (which we have to do).

I created a simple project reproducing the problem:

https://github.com/hugithordarson/xx-c42-listen/

…with the demonstration being here:

https://github.com/hugithordarson/xx-c42-listen/blob/main/src/main/java/xxc42/Main.java

Any thoughts or ideas? I haven't filed anything in Jira since I'm not sure if 
this issue really belongs with this one:

https://issues.apache.org/jira/browse/CAY-2735

The problems do smell related, not least due to both only manifesting in 
.excludeFromTransaction() mode, but they're still somewhat different since 
we're at a different lifecycle phase — and we're not performing any commits in 
our callbacks, just modifying objects in memory.

Cheers,
- hugi

Reply via email to