nowo-tech/doctrine-deadlock-retry-bundle
最新稳定版本:v2.0.0
Composer 安装命令:
composer require nowo-tech/doctrine-deadlock-retry-bundle
包简介
Symfony bundle that retries Doctrine flush and custom operations on DBAL deadlock exceptions with configurable profiles.
README 文档
README
⭐ 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
- DeadlockRetryService:
flush(?string $profile)andretry(callable $operation, ?string $profile). - Named profiles: configure
max_retries,sleep_ms, androllback_on_deadlockper use case. - Default profile: used when no profile name is passed.
- Detects
DeadlockExceptionand related driver errors in the exception chain.
Documentation
- Installation
- Configuration
- Usage
- Contributing
- Changelog
- Upgrading
- Release
- Security
- Engram
- Spec-driven development
Additional documentation
- Demo (Symfony 7 & 8) — run
make -C demo up-symfony8from the bundle root. - Demo with FrankenPHP (development and production) — includes FrankenPHP worker mode for production demos.
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
- PHP >= 8.2, < 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: PHPUnit (PHP)
- PHP: 100%
Version policy
The Composer package is nowo-tech/doctrine-deadlock-retry-bundle. Source and issues: nowo-tech/DoctrineDeadlockRetryBundle.
We follow Semantic Versioning. See Changelog. Security support is described in the Security policy.
License
MIT. See LICENSE.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-06-11