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

Add "Nested Transactions" section #355

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wata727
Copy link
Contributor

@wata727 wata727 commented Feb 11, 2024

@pirj

This comment was marked as off-topic.

@wata727
Copy link
Contributor Author

wata727 commented Mar 13, 2024

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.

Copy link
Member

@pirj pirj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes total sense.

I apologize for an unrelated reference above.

Here are some related references:

@pirj pirj requested review from koic and andyw8 July 26, 2024 22:32
@@ -847,6 +847,28 @@ else
end
----

=== Nested Transactions [[nested-transactions]]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to what I said in the corresponding RuboCop PR, I think we could group this into a section about avoiding private APIs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your suggestion.

However, there may be different reasons why private APIs should not be used, so I'm wondering if it's appropriate to group them all in one section.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the section should remain as it is because the focus should be more on the issues that arise with nested transactions rather than the use of private APIs.

@wata727 I’ve been reading your blog, and I was wondering if you could elaborate a bit more on after_commit in this style guide?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking about this PR again now, and I'm beginning to think that the section might not be suitable as a "style guide." I believe it’s worth having RuboCop find the problems caused by joinable: false, but it might be endless to list all such problems in the style guide.

@koic Is there a chance we could add a cop without adding it to the style guide, or do you think problems like this are worth mentioning in the style guide?

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.

4 participants