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

fix: Noop in case there is no change in autocommit value for setAutocommit() method #2662

Merged
merged 5 commits into from Oct 10, 2023

Conversation

ankiaga
Copy link
Contributor

@ankiaga ankiaga commented Oct 9, 2023

Noop in case there is no change in autocommit value for setAutocommit() method

@ankiaga ankiaga requested a review from a team as a code owner October 9, 2023 08:22
@product-auto-label product-auto-label bot added size: s Pull request size is small. api: spanner Issues related to the googleapis/java-spanner API. labels Oct 9, 2023
@olavloite
Copy link
Collaborator

A couple of general comments on the pull request itself:

  1. Try to make the first line of the commit message 80 characters or less. Alternatively; manually edit the title of the pull request so it's not broken into a part that is in the title and a part that is in the description.
  2. The semantic prefix should be written using all lower-case letters (so fix: instead of Fix:)
  3. Add a description to the pull request. GitHub creates this automatically if you format your commit message as follows:
fix: my pull request header

My Pull Request description that may span
multiple lines. If your pull request also fixes a
specific issue, then you should end your commit
message with a suffix that says 'Fixes #github_issue_number'.

Fixes #2662

@ankiaga ankiaga changed the title Fix: Noop in case there is no change in autocommit value for setAutocommit() method fix: Noop in case there is no change in autocommit value for setAutocommit() method Oct 9, 2023
@product-auto-label product-auto-label bot added size: m Pull request size is medium. and removed size: s Pull request size is small. labels Oct 9, 2023
Copy link
Collaborator

@olavloite olavloite left a comment

Choose a reason for hiding this comment

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

LGTM with a couple of minor nits.

subject.execute(Statement.of("begin transaction"));

subject.setAutocommit(false);
fail("Cannot set autocommit while in a temporary transaction");
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: use assertThrows(..) for this.

I know that there are examples in this test class that use this setup with a try-fail block. Those are however left-overs from when this library had to support Java 7, and we did not have support for lambda expressions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@ankiaga ankiaga added the owlbot:run Add this label to trigger the Owlbot post processor. label Oct 10, 2023
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Oct 10, 2023
@ankiaga ankiaga requested a review from a team as a code owner October 10, 2023 10:17
@ankiaga ankiaga merged commit 9f51b64 into googleapis:main Oct 10, 2023
22 checks passed
@ankiaga ankiaga deleted the fix-autocommit-noop branch October 10, 2023 10:55
gcf-merge-on-green bot pushed a commit that referenced this pull request Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the googleapis/java-spanner API. size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants