PHPackages                             swoole-bundle/resetter-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. swoole-bundle/resetter-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

swoole-bundle/resetter-bundle
=============================

Symfony bundle with resetters for various connections, e.g. doctrine/dbal and phpredis.

2.0.1(1mo ago)318.7k↑53.5%4[5 PRs](https://github.com/symfony-swoole/resetter-bundle/pulls)1MITPHPPHP &gt;=8.3CI passing

Since Feb 1Pushed 1mo agoCompare

[ Source](https://github.com/symfony-swoole/resetter-bundle)[ Packagist](https://packagist.org/packages/swoole-bundle/resetter-bundle)[ Docs](https://github.com/swoole-bundle/resetter-bundle)[ RSS](/packages/swoole-bundle-resetter-bundle/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (6)Dependencies (52)Versions (19)Used By (1)

Doctrine resettable entity manager 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](https://github.com/symfony-swoole/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
-----------

[](#instalation)

`composer require swoole-bundle/resetter-bundle`

### Optional: Doctrine ORM

[](#optional-doctrine-orm)

`doctrine/orm` is not a hard requirement. Install it only if you also want the entity managers to be wrapped in a `ResettableEntityManager` (cleared/reset between requests):

`composer require doctrine/orm`

When ORM is absent, the entity-manager decoration is skipped automatically.

SETUP
-----

[](#setup)

```
// config/bundles.php
return [
    //...
    \SwooleBundle\ResetterBundle\SwooleBundleResetterBundle::class => ['all' => true]
    //...
];
```

```
swoole_bundle_resetter:
  exclude_from_processing:
    # these entity managers won't be wrapped by the resettable entity manager:
    entity_managers:
        - readonly
    # these dbal connections won't be assigned to the keep alive handler
    dbal:
      - readonly
    # these redis cluster connections won't be assigned to the keep alive handler
    redis_cluster:
        - default
  # default 0 - if set, the connection ping operation will be executed each X seconds
  # (instead of at the beginning of each request)
  ping_interval: 10
  # default false - if set to true, the app will check if there is an active transaction
  # in the processed connection, and it will rollback the transaction
  check_active_transactions: true
  # for reader writer connections, each has to be defined as 'reader' or 'writer' to be able for the symfony
  # app to reconnect after db failover. currently only AWS Aurora is supported.
  failover_connections:
    default: writer
  # redis clusters which need to be failed over should be registered here
  # it's really important to set default timeouts to a low value, e.g. 2 seconds, so the app won't block for too long
  redis_cluster_connections:
    default: 'RedisCluster' # connection name (can be literally anything) => redis cluster service id
```

###  Health Score

54

—

FairBetter than 96% of packages

Maintenance94

Actively maintained with recent releases

Popularity33

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 79.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~97 days

Recently: every ~73 days

Total

6

Last Release

30d ago

Major Versions

1.2.0 → 2.0.02026-02-08

PHP version history (2 changes)1.0.0PHP &gt;= 8.2

1.2.0PHP &gt;=8.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/64753681?v=4)[Swoole Bundle](/maintainers/swoole-bundle)[@swoole-bundle](https://github.com/swoole-bundle)

---

Top Contributors

[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (83 commits)")[![Rastusik](https://avatars.githubusercontent.com/u/1735097?v=4)](https://github.com/Rastusik "Rastusik (19 commits)")[![kkichehlov-lendable](https://avatars.githubusercontent.com/u/274255580?v=4)](https://github.com/kkichehlov-lendable "kkichehlov-lendable (2 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/swoole-bundle-resetter-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/swoole-bundle-resetter-bundle/health.svg)](https://phpackages.com/packages/swoole-bundle-resetter-bundle)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M388](/packages/easycorp-easyadmin-bundle)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1616.4k14](/packages/2lenet-crudit-bundle)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M738](/packages/sylius-sylius)[pimcore/pimcore

Content &amp; Product Management Framework (CMS/PIM/E-Commerce)

3.8k3.8M508](/packages/pimcore-pimcore)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9421.6k61](/packages/open-dxp-opendxp)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1189.8k](/packages/rcsofttech-audit-trail-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
