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

Refactor some code related to the transaction manager #2366

Merged
merged 1 commit into from
Mar 14, 2024

Conversation

jianglai
Copy link
Collaborator

@jianglai jianglai commented Mar 12, 2024

Removed the deprecation mark as it is natural to expose methods related
to a transaction like getting the entity manager or checking if one is
in a transaction through the transaction manager interface.


This change is Reviewable

Copy link
Collaborator Author

@jianglai jianglai left a comment

Choose a reason for hiding this comment

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

Reviewed 5 of 5 files at r1, 2 of 2 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @weiminyu)

@jianglai jianglai force-pushed the mutating-flow branch 2 times, most recently from 5829dd0 to ab137d1 Compare March 13, 2024 13:43
Removed the deprecation mark as it is natural to expose methods related
to a transaction like getting the entity manager or checking if one is
in a transaction through the transaction manager interface.
Copy link
Collaborator

@weiminyu weiminyu left a comment

Choose a reason for hiding this comment

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

The changes rolled back was part of the attempt to fix the misleading use of tm() and replicatedTm() methods,
which appears to control which DB is in use but in fact is not in control.

The attempted fix was to pass a handle to JPA methods to the transaction body. It is
infeasible, with the biggest issue being Java cannot deduce the type of a lambda with parameters.
Everywhere a transaction result is not assigned to a variable first, the code needs to be rewritten.

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @jianglai)

Copy link
Collaborator

@weiminyu weiminyu left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 5 files at r1, 2 of 2 files at r2.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @jianglai)

@jianglai jianglai added this pull request to the merge queue Mar 14, 2024
Copy link
Collaborator Author

@jianglai jianglai left a comment

Choose a reason for hiding this comment

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

Yeah, I think we probably gave up on that idea. Still, the question remains that calling replicatTm() doesn't always do what you want if you call it within a transaction...

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @jianglai)

Merged via the queue into google:master with commit b9cfa65 Mar 14, 2024
9 checks passed
@jianglai jianglai deleted the mutating-flow branch March 14, 2024 15:29
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