feat(spanner): set read lock mode at client level#16068
feat(spanner): set read lock mode at client level#16068scotthart merged 1 commit intogoogleapis:mainfrom
Conversation
The read lock mode can be set at the client level, which is then set as the read lock mode in all RW transactions. However, the read lock mode can be overridden at a transaction level by explicitly specifying the read lock mode in the transaction options. Also adds a sample for setting the read lock mode at the client level and overriding it at the transaction level.
There was a problem hiding this comment.
Code Review
This pull request introduces the TransactionReadLockModeOption to allow configuration of transaction read lock modes (Optimistic or Pessimistic) in Google Cloud Spanner. The changes include updating the transaction option mapping logic to support this new setting, adding a code sample to demonstrate its usage at both the client and transaction levels, and implementing unit tests to verify the precedence of these options. I have no feedback to provide as there were no review comments.
|
/gcbrun |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #16068 +/- ##
==========================================
- Coverage 92.69% 92.68% -0.02%
==========================================
Files 2343 2343
Lines 216674 216737 +63
==========================================
+ Hits 200852 200884 +32
- Misses 15822 15853 +31 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
The read lock mode can be set at the client level, which is then set as the read lock mode in all RW transactions. However, the client-level read lock mode can be overridden at a transaction level by explicitly specifying the read lock mode in the transaction options.
Also adds a sample for setting the read lock mode at the client level and overriding it at the transaction level.