Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

改进事务中的断连重试处理,避免造成数据污染 #234

Merged
merged 3 commits into from
Feb 19, 2021

Conversation

NHZEX
Copy link
Member

@NHZEX NHZEX commented Feb 19, 2021

  1. 参考laravel的断连重试关键字进行补充 https://github.com/laravel/framework/blame/8.x/src/Illuminate/Database/DetectsLostConnections.php
  2. 缩小查询异常的捕获范围到\PDOException ,仅处理可预知的异常(PHP7.4以下版本兼容有问题)
  3. 在事务中执行查询时不能进行断连重试,防止造成数据污染。
  4. 嵌套事务中不能对startTranssavepoint进行断连重试,防止造成数据污染。

close #231

@NHZEX NHZEX marked this pull request as draft February 19, 2021 06:47
@NHZEX NHZEX marked this pull request as ready for review February 19, 2021 09:35
@liu21st liu21st merged commit 123a095 into top-think:2.0 Feb 19, 2021
@NHZEX NHZEX deleted the patch-8 branch March 3, 2021 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

在事务执行时连接中断重连导致出现数据不一致的情况
2 participants