Hi Jurgen,

Yeah, this seems like a problem here, thanks for finding it.

Delete part is indeed intended behavior and introduced some time ago (I'm
not quite sure when),
and Cayenne 4.2 had a significant refactoring that altered the overall
logic of flattened relationships.
The idea here is that the main object tracks and manages all related
flattened objects, otherwise they could just clutter the DB.

So reverting to a 3.1 logic is not an option here unfortunately.

We could (and probably should) get smarter logic that decides if we need to
delete a flattened row.
Looking at the code, we may need to change not the delete part, but rather
the tracking part (e.g. what goes to the ObjectStore.trackedFlattenedPaths)

Would be great if you could provide a test case for this.

Reply via email to