[FLOW3-general] Possible Memory Problem within Flow3

Karsten Dambekalns karsten at typo3.org
Fri Dec 2 15:25:17 CET 2011


Hi Chris.

On 01.12.11 11:24, Chris Zepernick {SwiftLizard} wrote:
> But we have a scenario where we use a custom repository so that we can
> use an additional persistence layer. The expected behaviour for me would
> be that the new entity would be stored in that persistence manager
> but instead it is stored in the default one.

So you have a custom PersistenceManager?

> The workaround for that I discovered is similar to this:
 ...
> Ugly but it works and keeps the memory usage low. If I strip the last
> two line the memory usage will increase on each circle of the foreach.

Basically that is
http://www.doctrine-project.org/docs/orm/2.1/en/reference/batch-processing.html#iterating-large-results-for-data-processing
- only we do not expose detach so far.

> Last thing we discovered yesterday, that the is no option in the
> repository to create an updateQuery or deleteQuery ?
> Is there a reason for that, or will that be implemented later ?

The reason is that the QOM has DDD in mind, and there you have deletion
of things as part of your domain logic. You remove an object relation
and the data will vanish in the background.

Of course in "real life" the use of bulk operations is useful to speed
up things. That's when you decide on a specific technical base and would
in your case use DQL to do batch updates and deletions. Again, see
http://www.doctrine-project.org/docs/orm/2.1/en/reference/batch-processing.html.

Regards,
Karsten


More information about the FLOW3-general mailing list