Skip to content

Commit 53fb21d

Browse files
committed
Documented the doctrine_clear_entity_manager middleware
1 parent d9c56c7 commit 53fb21d

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
@@ -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+
14551467
Messenger Events
14561468
~~~~~~~~~~~~~~~~
14571469

0 commit comments

Comments
 (0)