GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: add support for tagging to Connection API by olavloite · Pull Request #623 · googleapis/java-spanner

This repository was archived by the owner on Aug 30, 2026. It is now read-only.

Conversation

@olavloite

@olavloite olavloite commented Nov 13, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Adds support for tagging in the Connection API. This is needed to support tagging in the JDBC driver.

This is a binary breaking change, as it adds 4 methods to the Connection interface. That interface is marked as @InternalApi and warns that it may make breaking changes without prior notice.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@olavloite olavloite added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Nov 13, 2020
@olavloite
olavloite requested review from a team and thiagotnunes November 13, 2020 17:20
@google-cla google-cla Bot added the cla: yes This human has signed the Contributor License Agreement. label Nov 13, 2020
@product-auto-label product-auto-label Bot added the api: spanner Issues related to the googleapis/java-spanner API. label Nov 13, 2020
@olavloite olavloite changed the title Connection api tagging feat: add support for tagging to Connection API Nov 13, 2020
yoshi-code-bot
yoshi-code-bot reviewed Nov 13, 2020
View reviewed changes

@yoshi-code-bot yoshi-code-bot left a comment

Copy link
Copy Markdown

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.

Some suggestions could not be made:

  • google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/Connection.java
    • lines 38-38

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@olavloite olavloite mentioned this pull request Nov 13, 2020
feat: add support for tagging to JDBC connection googleapis/java-spanner-jdbc#270
Merged
thiagotnunes
thiagotnunes reviewed Nov 16, 2020
View reviewed changes
Comment thread google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionImpl.java
.setReadOnlyStaleness(readOnlyStaleness)
.setStatementTimeout(statementTimeout)
.withStatementExecutor(statementExecutor)
.setTransactionTag(transactionTag)

@thiagotnunes thiagotnunes Nov 16, 2020

Copy link
Copy Markdown
Contributor

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.

How will this behave if the user never set a transaction tag?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@olavloite olavloite Nov 16, 2020

Copy link
Copy Markdown
Contributor Author

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.

It is nullable, so that is not a problem. It is verified by this test case.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

thiagotnunes reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionImpl.java
}

@Override
public void setStatementTag(String tag) {

@thiagotnunes thiagotnunes Nov 16, 2020

Copy link
Copy Markdown
Contributor

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.

Out of curiosity, could we prevent the calling of this for a COMMIT? The user should not be able to do a statement tag in that case.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@olavloite olavloite Nov 16, 2020

Copy link
Copy Markdown
Contributor Author

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.

Good question. We can't prevent it before the COMMIT, but we can throw an exception if COMMIT is called after a statement tag has been set, and I think that makes sense as we are quite strict in checking the order of other statements (e.g. you are only allowed to get a commit timestamp if you actually committed etc.).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@olavloite olavloite Nov 16, 2020

Copy link
Copy Markdown
Contributor Author

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.

I've changed the implementation to check for this, and to throw an error if the application tries to set a statement tag for a COMMIT or ROLLBACK statement. This change also adds a change relating to DML batches: DML batches can only include one statement tag, as the statements are sent as one ExecuteBatchDmlRequest, which only allows one statement tag. This statement tag must be set before calling START BATCH DML, e.g.

SET STATEMENT_TAG = 'tag-1';
START BATCH DML;
INSERT INTO Singers (SingerId, Name) VALUES (1, 'Morrison');
INSERT INTO Singers (SingerId, Name) VALUES (2, 'Pieterson');
RUN BATCH;

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

thiagotnunes reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@olavloite
olavloite requested a review from thiagotnunes November 16, 2020 13:15
thiagotnunes
thiagotnunes approved these changes Nov 16, 2020
View reviewed changes
olavloite added 3 commits April 13, 2021 17:34
@olavloite
feat: add support for tagging in Connection API
a87dfdf
@olavloite
fix: disallow statement tags for commit/rollback/run
6c14164
@olavloite
chore: cleanup after rebase
510fdb3
@olavloite
olavloite force-pushed the connection-api-tagging branch from 3ab89ea to 510fdb3 Compare April 13, 2021 16:18
@olavloite olavloite removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Apr 13, 2021
@codecov

codecov Bot commented Apr 13, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

Merging #623 (0868a05) into master (004c5d7) will increase coverage by 0.17%.
The diff coverage is 86.90%.

❗ Current head 0868a05 differs from pull request most recent head df0b11d. Consider uploading reports for the commit df0b11d to get more accurate results
Impacted file tree graph

@@             Coverage Diff              @@
##             master     #623      +/-   ##
============================================
+ Coverage     85.06%   85.23%   +0.17%     
- Complexity     2585     2687     +102     
============================================
  Files           143      155      +12     
  Lines         14130    14531     +401     
  Branches       1368     1376       +8     
============================================
+ Hits          12019    12386     +367     
- Misses         1540     1570      +30     
- Partials        571      575       +4     
Impacted Files Coverage Δ
...a/com/google/cloud/spanner/SessionPoolOptions.java 69.53% <ø> (-0.79%) ⬇️
.../java/com/google/cloud/spanner/SpannerOptions.java 89.50% <ø> (-0.04%) ⬇️
...a/com/google/cloud/spanner/TransactionManager.java 100.00% <ø> (ø)
...spanner/admin/database/v1/DatabaseAdminClient.java 87.96% <ø> (+4.74%) ⬆️
...anner/admin/database/v1/DatabaseAdminSettings.java 15.94% <ø> (ø)
...nner/admin/database/v1/stub/DatabaseAdminStub.java 3.70% <ø> (ø)
...in/database/v1/stub/DatabaseAdminStubSettings.java 93.45% <ø> (-0.10%) ⬇️
...base/v1/stub/GrpcDatabaseAdminCallableFactory.java 50.00% <ø> (ø)
.../admin/database/v1/stub/GrpcDatabaseAdminStub.java 97.60% <ø> (+0.29%) ⬆️
...spanner/admin/instance/v1/InstanceAdminClient.java 82.99% <ø> (+3.85%) ⬆️
... and 122 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f257671...df0b11d. Read the comment docs.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

olavloite added 2 commits April 13, 2021 20:16
@olavloite
test: add generated tests + cleanup
d9f9ca8
@olavloite
build: add new methods to clirr
2a6c635
@googleapis googleapis deleted a comment from generated-files-bot Bot Apr 13, 2021
@googleapis googleapis deleted a comment from generated-files-bot Bot Apr 13, 2021
@olavloite

olavloite commented Apr 13, 2021

Copy link
Copy Markdown
Contributor Author

@thiagotnunes Would you mind taking a final look before I merge? I've rebased on master and realigned with the last choice that were made for tagging in the client library. Also: This is a binary breaking change as it adds methods to the Connection interface. Do we need a version bump for this?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@thiagotnunes thiagotnunes added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Apr 14, 2021
olavloite added 2 commits April 14, 2021 10:47
@olavloite
fix: add default implementations for new methods
0868a05
@olavloite
Merge branch 'master' into connection-api-tagging
df0b11d
@olavloite olavloite added automerge Merge the pull request once unit tests and other checks pass. and removed do not merge Indicates a pull request not ready for merge, due to either quality or timing. labels Jul 5, 2021
@olavloite
olavloite merged commit 5722372 into master Jul 5, 2021
@olavloite
olavloite deleted the connection-api-tagging branch July 5, 2021 08:45
@gcf-merge-on-green gcf-merge-on-green Bot removed the automerge Merge the pull request once unit tests and other checks pass. label Jul 5, 2021
gcf-merge-on-green Bot pushed a commit that referenced this pull request Jul 5, 2021
@release-please
chore: release 6.9.0 (#1267)
7cfffe3
🤖 I have created a release \*beep\* \*boop\*
---
## [6.9.0](https://www.github.com/googleapis/java-spanner/compare/v6.8.0...v6.9.0) (2021-07-05)


### Features

* add support for tagging to Connection API ([#623](https://www.github.com/googleapis/java-spanner/issues/623)) ([5722372](https://www.github.com/googleapis/java-spanner/commit/5722372b7869828e372dec06e80e5b0e7280af61))
* **spanner:** add leader_options to InstanceConfig and default_leader to Database ([#1271](https://www.github.com/googleapis/java-spanner/issues/1271)) ([f257671](https://www.github.com/googleapis/java-spanner/commit/f25767144344f0df67662f1b3ef662902384599a))
* support setting an async executor provider ([#1263](https://www.github.com/googleapis/java-spanner/issues/1263)) ([369c8a7](https://www.github.com/googleapis/java-spanner/commit/369c8a771ec48fa1476236f800b0e8eb5982a33c))


### Dependencies

* update dependency com.google.cloud:google-cloud-shared-dependencies to v1.4.0 ([#1269](https://www.github.com/googleapis/java-spanner/issues/1269)) ([025e162](https://www.github.com/googleapis/java-spanner/commit/025e162813d6321dabe49e32f00934f9ae334e24))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
ansh0l pushed a commit to ansh0l/java-spanner that referenced this pull request Nov 10, 2022
@codyoss
chore(all): auto-regenerate .pb.go files (googleapis#623)
c5cf324
This is an auto-generated regeneration of the .pb.go files by
cloud.google.com/go/internal/gapicgen. Once this PR is submitted, genbot will
update the corresponding PR to depend on the newer version of go-genproto, and
assign reviewers. Whilst this or any regen PR is open in go-genproto, genbot
will not create any more regeneration PRs. If all regen PRs are closed,
gapicgen will create a new set of regeneration PRs once per night.

If you have been assigned to review this PR, please:

- Ensure that CI is passing. If it's failing, it requires your manual attention.
- Approve and submit this PR if you believe it's ready to ship. That will prompt
genbot to assign reviewers to the google-cloud-go PR.

Corresponding google-cloud-go PR: googleapis/google-cloud-go#4311

Changes:

chore: Update networksecurity v1beta1 BUILD.bazel for python
  PiperOrigin-RevId: 381257429
  Source-Link: googleapis/googleapis@f5b06c2

chore: regenerate API index

  Source-Link: googleapis/googleapis@8cd4d12

feat(servicedirectory): Update Service Directory v1beta1 protos to include VPC Network field, and create/modify timestamp fields.
  PiperOrigin-RevId: 381234166
  Source-Link: googleapis/googleapis@d69baf2

fix(servicecontrol): add dependency log_severity.proto
  Committer: @summerji
  PiperOrigin-RevId: 381179420
  Source-Link: googleapis/googleapis@8b976f7

feat(spanner): add JSON type
  PiperOrigin-RevId: 381156241
  Source-Link: googleapis/googleapis@fb5c4fb

chore: regenerate API index

  Source-Link: googleapis/googleapis@c4d3151

feat: filestore public protos
  Committer: @vchudnov-g
  PiperOrigin-RevId: 381148500
  Source-Link: googleapis/googleapis@4c8d14a

feat(asset): add new searchable fields (memberTypes, roles, project, folders and organization), new request fields (assetTypes and orderBy) and new response fields (assetType, folders and organization) in SearchAllIamPolicies
  PiperOrigin-RevId: 381145907
  Source-Link: googleapis/googleapis@5d301f9

chore: regenerate API index

  Source-Link: googleapis/googleapis@aeb62a6

feat: dataflow public protos
  Committer: @alexander-fenster
  PiperOrigin-RevId: 380930750
  Source-Link: googleapis/googleapis@3dc9b8e

chore: regenerate API index

  Source-Link: googleapis/googleapis@02f6236

feat: networksecurity public protos
  Committer: @alexander-fenster
  PiperOrigin-RevId: 380923948
  Source-Link: googleapis/googleapis@370df45

chore: release gapic-generator-java v1.0.15
  Committer: @miraleung
  PiperOrigin-RevId: 380916790
  Source-Link: googleapis/googleapis@7c7d22f

chore: remove legacy, unused YAML from gapic directory
  PiperOrigin-RevId: 380835888
  Source-Link: googleapis/googleapis@dba65e3

chore(resourcesettings): update resourcesettings build rules
  Committer: @neenushaji
  PiperOrigin-RevId: 380831596
  Source-Link: googleapis/googleapis@2c1d1b2

build(clouddms): fix package name hint
  PiperOrigin-RevId: 380817131
  Source-Link: googleapis/googleapis@284d1dd

feat(documentai): update ReviewDocumentRequest to allow set priority and enable validation.
  PiperOrigin-RevId: 380732771
  Source-Link: googleapis/googleapis@87fc4d4

feat!(dialogflow/cx): mark agent.default_language_code as required feat: add return_partial response to Fulfillment docs: add notes to train agent before sending queries
  PiperOrigin-RevId: 380726996
  Source-Link: googleapis/googleapis@a5cec0a

chore: Update source_v1 BUILD.bazel for python
  PiperOrigin-RevId: 380710437
  Source-Link: googleapis/googleapis@0e48ca4

chore: regenerate API index

  Source-Link: googleapis/googleapis@89b01d8

feat(pubsublite): Add SeekSubscription and Operations to API
  PiperOrigin-RevId: 380660182
  Source-Link: googleapis/googleapis@b601f02

chore(gkeconnect/gateway): fix multi-version package names in grpc_service_config for gkeconnect
  Committer: @miraleung
  PiperOrigin-RevId: 380655273
  Source-Link: googleapis/googleapis@9250dff

chore: remove all monolith Bazel deps chore: release gapic-generator-csharp v1.3.7 chore: release gapic-generator-go 0.20.5 chore: release gapic-generator-java 1.0.14 chore: release gapic-generator-php 1.0.1 chore: release gapic-generator-python 0.50.0 chore: update gapic-generator-ruby to the latest commit chore: release gapic-generator-typescript 1.5.0
  Committer: @miraleung
  PiperOrigin-RevId: 380641501
  Source-Link: googleapis/googleapis@076f7e9

docs(dialogflow): added notes to train agent prior to sending queries fix: added resource reference to agent_version
  PiperOrigin-RevId: 380595849
  Source-Link: googleapis/googleapis@5fe3c63

docs(dialogflow/cx): added notes to train agent before sending queries
  PiperOrigin-RevId: 380267079
  Source-Link: googleapis/googleapis@01bad53

chore(gkeconnect/gateway): Update gkeconnect/gateway v1beta1 BUILD.bazel for python
  PiperOrigin-RevId: 380077711
  Source-Link: googleapis/googleapis@9d8dbc0

chore: regenerate API index

  Source-Link: googleapis/googleapis@052eb55

chore(resourcemanager): remove protoc-gen-docs_plugin from WORKSPACE
  PiperOrigin-RevId: 380020641
  Source-Link: googleapis/googleapis@cb44b17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

2 more reviewers
@yoshi-code-bot yoshi-code-bot yoshi-code-bot left review comments
@thiagotnunes thiagotnunes thiagotnunes approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

api: spanner Issues related to the googleapis/java-spanner API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@olavloite @thiagotnunes @yoshi-code-bot
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.