I am currently implementing a web application in TYPO3 7/Extbase which has a complex object structure consisting of a root object and a tree of child objects.
Let's say it resembles a more complex version of:
Object A <--1:n--> Object B <--1:n--> Object C
Since instances of object a are aggregate roots I use an Object-A-Repository to persist the tree.
This worked well, for performance reasons I switched many of the relations to lazy loading though (making their object stoages lazy). This sped up the application immensely, but not all update() calls to the Object-A-Repository seem to work anymore. The problem occurs in cases where a method receives an object of type C, changes it and needs to persist the changes. C has parent links to his parent B, and B has a parent link to A (the lazy object storage's counterparts).
The problem seems to be related to the LazyObjectStorages not replacing themselves with the actual content (because the A object didn't use it's "side" of the relation in this case). If I call DebuggerUtility::var_dump() on the object before updating it, persistence works perfectly. If I don't, the database does not change.
Is there a way to force an object to load all it's lazy storages? Or should I go about solving this another way?