payload icon indicating copy to clipboard operation
payload copied to clipboard

feat: retry transactions using withTransaction

Open DanRibbens opened this issue 2 years ago • 2 comments

Description

Changing to withTransaction instead of calling beginTransaction and start/rollback directly. This is a documented way to retry failing database operations to reduce errors from being unable to attain locks.

Related: https://github.com/payloadcms/payload/issues/4160 https://github.com/payloadcms/payload/issues/4133 https://github.com/payloadcms/payload/issues/4350 https://github.com/payloadcms/payload/issues/4273

  • [x] I have read and understand the CONTRIBUTING.md document in this repository.

Type of change

  • [x] New feature (non-breaking change which adds functionality)

Checklist:

  • [ ] I have added tests that prove my fix is effective or that my feature works
  • [x] Existing test suite passes locally with my changes
  • [ ] I have made corresponding changes to the documentation

DanRibbens avatar Dec 26 '23 16:12 DanRibbens

Any update on getting this merged @DanRibbens ?

denolfe avatar Apr 02 '24 14:04 denolfe

I don't think this fix worked as I expected when I packaged it up and tried it in repos that could reproduce this issue. The PR should probably be closed until we can revisit it. However, I don't want to delete this branch yet so I've kept it open.

DanRibbens avatar Apr 02 '24 19:04 DanRibbens