File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Filter options
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:
1403
1403
# or pass a different entity manager to any
1404
1404
# - doctrine_transaction: ['custom']
1405
1405
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
+
1406
1411
.. code-block :: xml
1407
1412
1408
1413
<!-- config/packages/messenger.xml -->
@@ -1428,6 +1433,8 @@ may want to use:
1428
1433
<framework:argument>custom</framework:argument>
1429
1434
</framework:middleware>
1430
1435
-->
1436
+
1437
+ <framework : middleware id =" doctrine_clear_entity_manager" />
1431
1438
</framework : bus >
1432
1439
</framework : messenger >
1433
1440
</framework : config >
@@ -1446,12 +1453,17 @@ may want to use:
1446
1453
'doctrine_close_connection',
1447
1454
// Using another entity manager
1448
1455
['id' => 'doctrine_transaction', 'arguments' => ['custom']],
1456
+ 'doctrine_clear_entity_manager',
1449
1457
],
1450
1458
],
1451
1459
],
1452
1460
],
1453
1461
]);
1454
1462
1463
+ .. versionadded :: 4.4
1464
+
1465
+ The ``doctrine_clear_entity_manager `` middleware was introduced in Symfony 4.4.
1466
+
1455
1467
Messenger Events
1456
1468
~~~~~~~~~~~~~~~~
1457
1469
You can’t perform that action at this time.
0 commit comments