-
Notifications
You must be signed in to change notification settings - Fork 269
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
Conversation
There was a problem hiding this 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: complete! all files reviewed, all discussions resolved (waiting on @weiminyu)
5829dd0
to
ab137d1
Compare
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.
There was a problem hiding this 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: complete! all files reviewed, all discussions resolved (waiting on @jianglai)
There was a problem hiding this 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: complete! all files reviewed, all discussions resolved (waiting on @jianglai)
There was a problem hiding this 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: complete! all files reviewed, all discussions resolved (waiting on @jianglai)
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