Skip to content

Commit 39c1290

Browse files
committed
Merge branch 'main' into last-statement
2 parents 34694b9 + 20a3d0d commit 39c1290

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

.github/workflows/hermetic_library_generation.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
with:
3838
fetch-depth: 0
3939
token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }}
40-
- uses: googleapis/sdk-platform-java/.github/scripts@v2.52.0
40+
- uses: googleapis/sdk-platform-java/.github/scripts@v2.53.0
4141
if: env.SHOULD_RUN == 'true'
4242
with:
4343
base_ref: ${{ github.base_ref }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ If you are using Maven without the BOM, add this to your dependencies:
4949
If you are using Gradle 5.x or later, add this to your dependencies:
5050

5151
```Groovy
52-
implementation platform('com.google.cloud:libraries-bom:26.53.0')
52+
implementation platform('com.google.cloud:libraries-bom:26.54.0')
5353
5454
implementation 'com.google.cloud:google-cloud-spanner'
5555
```

generation_config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
gapic_generator_version: 2.52.0
2-
googleapis_commitish: 3cf61b2df20eace09e6336c23f9e08859c0d87ae
3-
libraries_bom_version: 26.53.0
1+
gapic_generator_version: 2.53.0
2+
googleapis_commitish: 9605bff3d36fbdb1227b26bce68258c5f00815e4
3+
libraries_bom_version: 26.54.0
44
libraries:
55
- api_shortname: spanner
66
name_pretty: Cloud Spanner

google-cloud-spanner/src/main/java/com/google/cloud/spanner/TransactionManagerImpl.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,13 @@ public void commit() {
8080
} catch (SpannerException e2) {
8181
txnState = TransactionState.COMMIT_FAILED;
8282
throw e2;
83+
} finally {
84+
// At this point, if the TransactionState is not ABORTED, then the transaction has reached an
85+
// end state.
86+
// We can safely call close() to release resources.
87+
if (getState() != TransactionState.ABORTED) {
88+
close();
89+
}
8390
}
8491
}
8592

@@ -92,6 +99,9 @@ public void rollback() {
9299
txn.rollback();
93100
} finally {
94101
txnState = TransactionState.ROLLED_BACK;
102+
// At this point, the TransactionState is ROLLED_BACK which is an end state.
103+
// We can safely call close() to release resources.
104+
close();
95105
}
96106
}
97107

0 commit comments

Comments
 (0)