Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@olavloite
Copy link

The JDBC Driver contains an internal retry algorithm for aborted read/write transactions that rely on keeping track of a SHA-256 checksum for all data that is returned by Cloud Spanner. When a transaction is successfully retried, all open result sets must be replaced with a fresh one that is linked with the new transaction. This is achieved by returning result sets to the user that contain a delegate that may be replaced by the JDBC Driver at a later moment.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jul 24, 2019
@@ -0,0 +1,294 @@
/*
* Copyright 2018 Google LLC
Copy link
Contributor

Choose a reason for hiding this comment

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

2019

Copy link
Author

Choose a reason for hiding this comment

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

Changed.

try (ReplaceableForwardingResultSet subject = new ReplaceableForwardingResultSet(delegate)) {
subject.next();

subject.getBoolean(0);
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd make a note somewhere in the above implementation that column indexes start at 0

Copy link
Author

Choose a reason for hiding this comment

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

I added a note about this in the test case, as I assume that you mean that. In the class itself (ReplaceableForwardingResultSet), it is clear from the interface it is implementing that column indices are zero-based.

@olavloite olavloite requested a review from kolea2 July 24, 2019 20:32
@olavloite olavloite merged commit 9ece17b into googleapis:spanner-jdbc Jul 25, 2019
olavloite added a commit to olavloite/google-cloud-java that referenced this pull request Aug 5, 2019
* add ReplaceableForwardingResultSet

* fixed CR year

* added note for zero-based column indices + added vars for readability
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants