File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -1403,6 +1403,11 @@ may want to use:
14031403 # or pass a different entity manager to any
14041404 # - doctrine_transaction: ['custom']
14051405
1406+ # After handling, the clear() method is executed in the
1407+ # entity manager, which reduces the memory consumption and
1408+ # avoids side-effects related to unrefreshed entities
1409+ - doctrine_clear_entity_manager
1410+
14061411 .. code-block :: xml
14071412
14081413 <!-- config/packages/messenger.xml -->
@@ -1428,6 +1433,8 @@ may want to use:
14281433 <framework:argument>custom</framework:argument>
14291434 </framework:middleware>
14301435 -->
1436+
1437+ <framework : middleware id =" doctrine_clear_entity_manager" />
14311438 </framework : bus >
14321439 </framework : messenger >
14331440 </framework : config >
@@ -1446,12 +1453,17 @@ may want to use:
14461453 'doctrine_close_connection',
14471454 // Using another entity manager
14481455 ['id' => 'doctrine_transaction', 'arguments' => ['custom']],
1456+ 'doctrine_clear_entity_manager',
14491457 ],
14501458 ],
14511459 ],
14521460 ],
14531461 ]);
14541462
1463+ .. versionadded :: 4.4
1464+
1465+ The ``doctrine_clear_entity_manager `` middleware was introduced in Symfony 4.4.
1466+
14551467Messenger Events
14561468~~~~~~~~~~~~~~~~
14571469
You can’t perform that action at this time.
0 commit comments