googleapis / java-spanner Public
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
feat: introduce TransactionOptions and UpdateOptions #716
Conversation
Adds TransactionOptions and UpdateOptions for read/write transactions and statements. These can be used in the future to specify options to affect how transactions and statements will be executed.
google-cloud-spanner/src/main/java/com/google/cloud/spanner/Options.java
Show resolved
Hide resolved
google-cloud-spanner/src/main/java/com/google/cloud/spanner/Options.java
Show resolved
Hide resolved
@@ -340,10 +343,11 @@ public void run() { | |||
return res; | |||
} | |||
|
|||
TransactionContextImpl newTransaction() { | |||
TransactionContextImpl newTransaction(Options options) { |
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.
Can this be just TransactionOption
instead of Options
?
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.
That would be possible (assuming you mean TransactionOption...
), but I would prefer to keep this as the Options
object. This makes it a required argument, making it less likely to be missed by accident as it will cause a compile error if you don't supply an Options
object. If we change it to TransactionOption...
it would not cause a compile time error if we forget to pass in the options somewhere.
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.
Hmm, makes sense.
Codecov Report
@@ Coverage Diff @@
## master #716 +/- ##
============================================
+ Coverage 85.03% 85.12% +0.08%
- Complexity 2553 2561 +8
============================================
Files 142 142
Lines 13930 13952 +22
Branches 1326 1331 +5
============================================
+ Hits 11846 11877 +31
+ Misses 1527 1515 -12
- Partials 557 560 +3 Continue to review full report at Codecov.
|
@skuruppu Do you want to weigh in on this as well? It is technically a (binary) breaking change as we are adding |
I think previously, we haven't marked changes that break binary compatibility as breaking changes so this is fine. |
* feat: introduce TransactionOptions and UpdateOptions Adds TransactionOptions and UpdateOptions for read/write transactions and statements. These can be used in the future to specify options to affect how transactions and statements will be executed. * test: add options tests
Adds TransactionOptions and UpdateOptions for read/write transactions and statements. These can be used in the future to specify options to affect how transactions and statements will be executed.
These changes can be used as the basis for #676 and #576 to ensure both changes use the same approach, and to prevent enormous merge conflicts.