[TYPO3-mvc] RFC #8244: Changes made to a domain object sitting at a "dirty" property won't get persisted

Jochen Rau jochen.rau at typoplanet.de
Sat Jun 19 18:11:08 CEST 2010


Hi Franz.

On 2010-06-19, Franz Koch <typo3.RemoveForMessage at elements-net.de> wrote:
> Hey Jochen,
>
>> On 2010-06-18, Franz Koch<typo3.RemoveForMessage at elements-net.de>  wrote:
>>> crappy thunderbird :(
>>
>> Give slrn a try ;-)
>
> I need a bit more GUI ;)

quote: "crappy thunderbird :(" ;-)

>>> long story short: also +1 on testing, but with one remark. Now it could
>>> happen that you run into endless recursions if you have self-references
>>> of objects (just happened to me accidentally). So maybe we should add
>>> some recursion prevention here before committing.
>>
>> Did you test it before and after applying the patch?
>
>
> yes I did. Without the patch it worked just fine.
>
>> It is complicated to fetch this kind of recursion because it can also be on a second (and third ...) level. IMO this is a general problem (like the circular dependencies in construcor injection). I am going to commit this patch and document this "trap". Or do you think this is a blocker?
>
> And a protocol/stack/array storing the object hashes of already 
> persisted objects might not be a solution for that?
>
> --------------------
> if (!in_array(spl_object_hash($queuedObject), 
> $this->alreadyPersistedObjects) {
> 	$this->persistObject($queuedObject);
> }
> --------------------

I have implemented a first level "cache" (as Karsten already did in the latest backend refactoring) while I was working on issue #6130. Could you please test the new patch

http://forge.typo3.org/attachments/3271/issue_6130_v3.diff

>
> As you're working on the persistObject stuff right now, I just noticed a 
> partly redundancy. Have a look at lines 374-379, where the 
> objectStorages get persisted. After a call to 
> $this->persistObjectStorage(...) all contained items are looped and 
> added to the persistence queue. But that's already partly done on lines 
> 520-531 inside the persistObjectStorage function, right? Shouldn't that 
> be completely moved to the persistObjectStorage function?

I will have a look.

Regards
Jochen


More information about the TYPO3-project-typo3v4mvc mailing list