feat: Default transaction isolation#1998
Merged
olavloite merged 7 commits intogoogleapis:mainfrom Sep 12, 2022
Merged
Conversation
Contributor
|
@gauravsnj: Can we add a description for the PR to add some context for the changes? Also, can we add a few tests for this? |
olavloite
approved these changes
Sep 7, 2022
Collaborator
olavloite
left a comment
There was a problem hiding this comment.
LGTM (with a tiny request for a couple of extra tests)
| "begin isolation level serializable not deferrable", "start isolation level serializable not deferrable", "begin transaction isolation level serializable not deferrable", "start transaction isolation level serializable not deferrable", "begin work isolation level serializable not deferrable", "start work isolation level serializable not deferrable", | ||
| "begin isolation level default read write not deferrable", "start isolation level default read only not deferrable", "begin transaction isolation level default read only not deferrable", "start transaction isolation level default read write not deferrable", "begin work isolation level default read write not deferrable", "start work isolation level default read only not deferrable", | ||
| "begin isolation level serializable read write not deferrable", "start isolation level serializable read write not deferrable", "begin transaction isolation level serializable read only not deferrable", "start transaction isolation level serializable read write not deferrable", "begin work isolation level serializable read write not deferrable", "start work isolation level serializable read only not deferrable", | ||
| "begin isolation level serializable, read write, not deferrable", "start isolation level serializable, read write, not deferrable", "begin transaction isolation level serializable, read only, not deferrable", "start transaction isolation level serializable, read write, not deferrable", "begin work isolation level serializable, read write, not deferrable", "start work isolation level serializable, read only" |
Collaborator
There was a problem hiding this comment.
For completeness (and to prevent potential regressions in the future), could we also add a couple of tests with not deferrable as not the last option. So for example:
begin not deferrable read write;
begin not deferrable isolation level default;
ansh0l
reviewed
Sep 7, 2022
| public PgTransactionMode convert(String value) { | ||
| PgTransactionMode mode = new PgTransactionMode(); | ||
| // Transaction mode may contain multiple spaces. | ||
| String valueWithoutNotDeferrable = value.replaceAll("(?i)(not\\s+deferrable)", " "); |
Contributor
There was a problem hiding this comment.
nit: please check for a better variable name for valueWithoutNotDeferrable, the double negative makes it slightly confusing to read.
ansh0l
approved these changes
Sep 7, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #<issue_number_goes_here> ☕️
If you write sample code, please follow the samples format.