You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cloud Spanner Client should prevent nested transactions #2117
api: spannerIssues related to the Spanner API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.
Cloud Spanner does not support nested transactions. But the client library does allow users to call DatabaseClient.readWriteTransaction().run() inside of the callback that is provided to an outer DatabaseClient.readWriteTransaction().run(). This is misleading since users might believe that this will behave like a nested transaction but in reality these will be two independent transactions. This is confusing and a source of bugs. Specifically the inner transaction might succeed while the outer might ABORT, in which case the callback will be rerun thus rerunning the inner transaction.
We should prevent this from happening by detecting and raising an error if someone calls DatabaseClient.readWriteTransaction().run() inside the callback provided to DatabaseClient.readWriteTransaction().run(). Note that this needs to be done before GA since this is a known breaking change.
Also note that if we come across a use case where we do want to allow calling a nested run, we should be able to enable that in future without making a breaking change.
api: spannerIssues related to the Spanner API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.
Activity
garrettjonesgoogle commentedon Jun 20, 2017
GA-blocking issues shouldn't be marked P0; P0 is for issues where the latest release is DOA. Downgrading to P1.
bjwatson commentedon Aug 29, 2017
@vkedia @garrettjonesgoogle I added the
Release Blockinglabel to ensure this is fixed before GA.bjwatson commentedon Oct 16, 2017
FYI @anthmgoogle and @lukesneeringer
yihanzhen commentedon Jan 11, 2018
This has been added to our feature backlog: https://github.com/GoogleCloudPlatform/google-cloud-java/wiki/Feature-backlog . This issue will be closed but is linked in the backlog and can continue to be used for comment and discussion.
build: migrate release scripts (#1799) (#2117)
deps: update dependency com.google.cloud:google-cloud-spanner to v6.9…
deps: update dependency com.google.cloud:sdk-platform-java-config to …
test(deps): update dependency com.google.protobuf:protoc to v3.25.3 (g…