File tree 1 file changed +12
-0
lines changed 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -1375,6 +1375,11 @@ may want to use:
1375
1375
# or pass a different entity manager to any
1376
1376
# - doctrine_transaction: ['custom']
1377
1377
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
+
1378
1383
.. code-block :: xml
1379
1384
1380
1385
<!-- config/packages/messenger.xml -->
@@ -1400,6 +1405,8 @@ may want to use:
1400
1405
<framework:argument>custom</framework:argument>
1401
1406
</framework:middleware>
1402
1407
-->
1408
+
1409
+ <framework : middleware id =" doctrine_clear_entity_manager" />
1403
1410
</framework : bus >
1404
1411
</framework : messenger >
1405
1412
</framework : config >
@@ -1418,12 +1425,17 @@ may want to use:
1418
1425
'doctrine_close_connection',
1419
1426
// Using another entity manager
1420
1427
['id' => 'doctrine_transaction', 'arguments' => ['custom']],
1428
+ 'doctrine_clear_entity_manager',
1421
1429
],
1422
1430
],
1423
1431
],
1424
1432
],
1425
1433
]);
1426
1434
1435
+ .. versionadded :: 4.4
1436
+
1437
+ The ``doctrine_clear_entity_manager `` middleware was introduced in Symfony 4.4.
1438
+
1427
1439
Messenger Events
1428
1440
~~~~~~~~~~~~~~~~
1429
1441
You can’t perform that action at this time.
0 commit comments