Download the PHP package pixelfederation/doctrine-resettable-em-bundle without Composer
On this page you can find all versions of the php package pixelfederation/doctrine-resettable-em-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download pixelfederation/doctrine-resettable-em-bundle
More information about pixelfederation/doctrine-resettable-em-bundle
Files in pixelfederation/doctrine-resettable-em-bundle
Package doctrine-resettable-em-bundle
Short Description Symfony bundle for decorating default entity managers using a resettable decorator.
License MIT
Homepage https://github.com/pixelfederation/doctrine-resettable-em-bundle
Informations about the package doctrine-resettable-em-bundle
Doctrine resettable entity manager bundle
This bundle should be used with workloads where Symfony doesn't get initialized on each request, but stays in memory and the same instance handles multiple requests, one after another (e.g. when using Swoole Bundle). Another use case would be message queue consuming (e.g. Symfony messenger), where it is needed to clear (and possibly reset) the entity manager after processing a message.
The best feature of this bundle is, that it wraps all configured entity managers
into a ResettableEntityManager instance, which
is able to reset the entity manager when it gets stuck on an exception.
After each request the entity manager gets cleared or reset, if an exception occurred during request handling.
Also, another feature is that on each request start the entity manager connection gets pinged, so the connection won't get closed after some period of time.
Instalation
composer require pixelfederation/doctrine-resettable-em-bundle
SETUP
If you have php-fpm you need only handle RedisCluster on message queue consuming.
So you need to disable Initializers and disable processing for all dbal connections.
To enable ping on entity managers during message queue consuming, you can add doctrine_ping_connection middleware: https://symfony.com/doc/current/messenger.html#middleware-for-doctrine
All versions of doctrine-resettable-em-bundle with dependencies
doctrine/doctrine-bundle Version ^3.2
doctrine/orm Version ^3.6
symfony/config Version ^7.4 || ^8.0
symfony/dependency-injection Version ^7.4 || ^8.0
symfony/yaml Version ^7.4 || ^8.0