PHPackages                             nowo-tech/doctrine-deadlock-retry-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. [Database &amp; ORM](/categories/database)
4. /
5. nowo-tech/doctrine-deadlock-retry-bundle

ActiveSymfony-bundle[Database &amp; ORM](/categories/database)

nowo-tech/doctrine-deadlock-retry-bundle
========================================

Symfony bundle that retries Doctrine flush and custom operations on DBAL deadlock exceptions with configurable profiles.

v2.0.1(2w ago)03MITShellPHP &gt;=8.2 &lt;8.6CI passing

Since Jun 11Pushed 5d agoCompare

[ Source](https://github.com/nowo-tech/DoctrineDeadlockRetryBundle)[ Packagist](https://packagist.org/packages/nowo-tech/doctrine-deadlock-retry-bundle)[ Docs](https://github.com/nowo-tech/DoctrineDeadlockRetryBundle)[ GitHub Sponsors](https://github.com/HecFranco)[ RSS](/packages/nowo-tech-doctrine-deadlock-retry-bundle/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (6)Dependencies (28)Versions (6)Used By (0)

Doctrine Deadlock Retry Bundle
==============================

[](#doctrine-deadlock-retry-bundle)

[![CI](https://github.com/nowo-tech/DoctrineDeadlockRetryBundle/actions/workflows/ci.yml/badge.svg)](https://github.com/nowo-tech/DoctrineDeadlockRetryBundle/actions/workflows/ci.yml)[![Packagist Version](https://camo.githubusercontent.com/81ef2eab4cd12dc54ee71450e0d503bebef822c85641fdfd4afe7424ad71e1cf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e6f776f2d746563682f646f637472696e652d646561646c6f636b2d72657472792d62756e646c652e7376673f7374796c653d666c6174)](https://packagist.org/packages/nowo-tech/doctrine-deadlock-retry-bundle)[![Packagist Downloads](https://camo.githubusercontent.com/b8a6a7611874d85e47403fb96ebd9d143e897d703fb5040107494f7119ce9c90/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e6f776f2d746563682f646f637472696e652d646561646c6f636b2d72657472792d62756e646c652e737667)](https://packagist.org/packages/nowo-tech/doctrine-deadlock-retry-bundle)[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)[![PHP](https://camo.githubusercontent.com/3f99b197569aa2dcfbefff17ecc68d74098e7f929d8b52dc40f3a898f740eae1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e322532422d3737374242343f6c6f676f3d706870)](https://php.net)[![Symfony](https://camo.githubusercontent.com/b43d1688d52c63d771fe5f9f56c9120e3a4e9601779936d3dc0a436df1f874c3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53796d666f6e792d362e30253242253230253743253230372e34253242253230253743253230382e30253230253743253230382e312532422d3030303030303f6c6f676f3d73796d666f6e79)](https://symfony.com)[![GitHub stars](https://camo.githubusercontent.com/6705536377dd8ca7918c78ec388bd537f9d76a0914c84f73027723fb3973f91b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6e6f776f2d746563682f646f637472696e652d646561646c6f636b2d72657472792d62756e646c652e7376673f7374796c653d736f6369616c266c6162656c3d53746172)](https://github.com/nowo-tech/DoctrineDeadlockRetryBundle)[![Coverage](https://camo.githubusercontent.com/cd0704b56f1d56def350b6d0164316307bb2f47834225fd85443b6fb0059bc73/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436f7665726167652d3130302532352d627269676874677265656e)](#tests-and-coverage)

> ⭐ **Found this useful?** Install from Packagist and give it a star on GitHub.

Symfony bundle that retries `EntityManager::flush()` and custom operations when Doctrine DBAL raises a deadlock (`SQLSTATE[40001]`, MySQL error 1213).

Features
--------

[](#features)

- **DeadlockRetryService**: `flush(?string $profile)` and `retry(callable $operation, ?string $profile)`.
- **Named profiles**: configure `max_retries`, `sleep_ms`, and `rollback_on_deadlock` per use case.
- **Default profile**: used when no profile name is passed.
- Detects `DeadlockException` and related driver errors in the exception chain.

Documentation
-------------

[](#documentation)

- [GitHub Actions CI requirements](docs/GITHUB_CI.md)
- [Installation](docs/INSTALLATION.md)
- [Configuration](docs/CONFIGURATION.md)
- [Usage](docs/USAGE.md)
- [Contributing](docs/CONTRIBUTING.md)
- [Code of Conduct](CODE_OF_CONDUCT.md)
- [Changelog](docs/CHANGELOG.md)
- [Upgrading](docs/UPGRADING.md)
- [Release](docs/RELEASE.md)
- [Security](docs/SECURITY.md)
- [Engram](docs/ENGRAM.md)
- [Spec-driven development](docs/SPEC-DRIVEN-DEVELOPMENT.md)
- [GitHub Spec Kit](docs/SPEC-KIT.md)

### Additional documentation

[](#additional-documentation)

- [Demo (Symfony 7 &amp; 8)](demo/README.md) — run `make -C demo up-symfony8` from the bundle root.
- [Demo with FrankenPHP](docs/DEMO-FRANKENPHP.md) — `FRANKENPHP_MODE` (`classic` | `worker`, default **worker**).

Quick example
-------------

[](#quick-example)

```
use Nowo\DoctrineDeadlockRetryBundle\Service\DeadlockRetryService;

public function __construct(
    private readonly DeadlockRetryService $deadlockRetry,
) {
}

public function save(Order $order): void
{
    $this->entityManager->persist($order);
    $this->deadlockRetry->flush();
    $this->deadlockRetry->flush('batch');
}
```

Requirements
------------

[](#requirements)

- PHP &gt;= 8.2, &lt; 8.6 (Symfony 8.x requires PHP 8.4+)
- Symfony 6.0+ | 7.4+ | 8.0+ | 8.1+ (minimum tested minors: 7.4, 8.0, 8.1)
- Doctrine ORM and DoctrineBundle

Tests and coverage
------------------

[](#tests-and-coverage)

- Tests: PHPUnit (PHP)
- PHP: 100%

Version policy
--------------

[](#version-policy)

The Composer package is [`nowo-tech/doctrine-deadlock-retry-bundle`](https://packagist.org/packages/nowo-tech/doctrine-deadlock-retry-bundle). Source and issues: [`nowo-tech/DoctrineDeadlockRetryBundle`](https://github.com/nowo-tech/DoctrineDeadlockRetryBundle).

We follow [Semantic Versioning](https://semver.org/). See [Changelog](docs/CHANGELOG.md). Security support is described in the [Security policy](.github/SECURITY.md#supported-versions).

License
-------

[](#license)

MIT. See [LICENSE](LICENSE).

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance98

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 82.4% 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 ~9 days

Total

4

Last Release

18d ago

Major Versions

v1.0.1 → v2.0.02026-06-11

PHP version history (2 changes)v1.0.0PHP &gt;=8.1 &lt;8.6

v2.0.0PHP &gt;=8.2 &lt;8.6

### Community

Maintainers

![](https://www.gravatar.com/avatar/e7947bfc3f2ce9574a18a2c60f3d95b5d1b0740e65dc929332c92f1df21f75ab?d=identicon)[HecFranco](/maintainers/HecFranco)

---

Top Contributors

[![HecFranco](https://avatars.githubusercontent.com/u/24323276?v=4)](https://github.com/HecFranco "HecFranco (14 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")

---

Tags

symfonybundleormdoctrinedbalretrytransactiondeadlock

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/nowo-tech-doctrine-deadlock-retry-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/nowo-tech-doctrine-deadlock-retry-bundle/health.svg)](https://phpackages.com/packages/nowo-tech-doctrine-deadlock-retry-bundle)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

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

The easy like Crud'it Bundle.

1616.4k14](/packages/2lenet-crudit-bundle)[open-dxp/opendxp

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

9421.6k64](/packages/open-dxp-opendxp)

PHPackages © 2026

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