Skip to content

Commit 5fa0688

Browse files
committed
Merge branch '4.4'
* 4.4: Documented the doctrine_clear_entity_manager middleware
2 parents ef93cf4 + 414b707 commit 5fa0688

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

messenger.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1375,6 +1375,11 @@ may want to use:
13751375
# or pass a different entity manager to any
13761376
#- doctrine_transaction: ['custom']
13771377
1378+
# After handling, the clear() method is executed in the
1379+
# entity manager, which reduces the memory consumption and
1380+
# avoids side-effects related to unrefreshed entities
1381+
- doctrine_clear_entity_manager
1382+
13781383
.. code-block:: xml
13791384
13801385
<!-- config/packages/messenger.xml -->
@@ -1400,6 +1405,8 @@ may want to use:
14001405
<framework:argument>custom</framework:argument>
14011406
</framework:middleware>
14021407
-->
1408+
1409+
<framework:middleware id="doctrine_clear_entity_manager"/>
14031410
</framework:bus>
14041411
</framework:messenger>
14051412
</framework:config>
@@ -1418,12 +1425,17 @@ may want to use:
14181425
'doctrine_close_connection',
14191426
// Using another entity manager
14201427
['id' => 'doctrine_transaction', 'arguments' => ['custom']],
1428+
'doctrine_clear_entity_manager',
14211429
],
14221430
],
14231431
],
14241432
],
14251433
]);
14261434
1435+
.. versionadded:: 4.4
1436+
1437+
The ``doctrine_clear_entity_manager`` middleware was introduced in Symfony 4.4.
1438+
14271439
Messenger Events
14281440
~~~~~~~~~~~~~~~~
14291441

0 commit comments

Comments
 (0)