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 }}
This repository was archived by the owner on Apr 7, 2026. It is now read-only.
When testing the new R2DBC driver with the Cloud Spanner emulator, I noticed that the active transaction was not being rolled back despite AsyncTransactionManager.close() being called.
The contract for close() is to roll back the active transaction when closed, but I wonder if close() was not meant to be implemented as closeAsync() and kind of got left out.
Environment details
Spanner client library version: 1.59.0
Steps to reproduce
Start emulator and set the emulator environment variable (SPANNER_EMULATOR_HOST=localhost:9010). The issue has nothing to do with the emulator, but it's really easy to observe when using one.
Update "project", "instance", "database" to real values.
Set up the following table definition: gcloud spanner databases ddl update database --ddl="CREATE TABLE test ( value INT64 ) PRIMARY KEY (value)" --instance=instance
Run transactionManagerRollsBackTransactionWhenClosedtwice; observe that everything works as expected.
Run asyncTransactionManagerDoesNotRollBackTransactionWhenClosedtwice; observe that the first run succeeds, but the second fails with error io.grpc.StatusRuntimeException: ABORTED: Transaction NNN aborted due to active transaction MMM. The emulator only supports one transaction at a time.
When testing the new R2DBC driver with the Cloud Spanner emulator, I noticed that the active transaction was not being rolled back despite
AsyncTransactionManager.close()being called.The contract for
close()is to roll back the active transaction when closed, but I wonder ifclose()was not meant to be implemented ascloseAsync()and kind of got left out.Environment details
Spanner client library version: 1.59.0
Steps to reproduce
SPANNER_EMULATOR_HOST=localhost:9010). The issue has nothing to do with the emulator, but it's really easy to observe when using one.gcloud spanner databases ddl update database --ddl="CREATE TABLE test ( value INT64 ) PRIMARY KEY (value)" --instance=instancetransactionManagerRollsBackTransactionWhenClosedtwice; observe that everything works as expected.asyncTransactionManagerDoesNotRollBackTransactionWhenClosedtwice; observe that the first run succeeds, but the second fails with errorio.grpc.StatusRuntimeException: ABORTED: Transaction NNN aborted due to active transaction MMM. The emulator only supports one transaction at a time.