定制 nowo-tech/doctrine-deadlock-retry-bundle 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

CI Packagist Version Packagist Downloads License PHP Symfony

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) 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

Additional documentation

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-06-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固