rubocop / rails-style-guide

A community-driven Ruby on Rails style guide
http://rails.rubystyle.guide
6.48k stars 1.06k forks source link

Add "Nested Transactions" section #355

Open wata727 opened 9 months ago

wata727 commented 9 months ago

See also https://github.com/rubocop/rubocop-rails/pull/1236

pirj commented 8 months ago

I didn’t look close yet, but seems interested at a glance https://about.gitlab.com/blog/2021/09/29/why-we-spent-the-last-month-eliminating-postgresql-subtransactions/

wata727 commented 8 months ago

Thank you for sharing this article. This article seems to be referring to performance issues caused by nested transactions in PostgreSQL.

Please note that this PR is not about whether you should use nested transactions, but only that if you do, you should not use joinable: false. This is a fairly partial mention, so I'm honestly not sure if it should be added to the style guide.