Skip to content

feat: specify isolation level per transaction #3704

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

Merged
merged 9 commits into from
Mar 28, 2025

Conversation

olavloite
Copy link
Collaborator

Add an option to specify the isolation level for a single transaction. This isolation level overrides the current default isolation level that has been set for the connection. This option only has an effect for read/write transactions.

Add a `default_isolation_level` property for the Connection API.
This property will be used by the JDBC driver and PGAdapter to
set a default isolation level for all read/write transactions
that are executed by a connection.

Support for setting an isolation level for a single transaction
will be added in a follow-up pull request.
@olavloite olavloite requested review from a team as code owners March 20, 2025 13:36
@product-auto-label product-auto-label bot added size: l Pull request size is large. api: spanner Issues related to the googleapis/java-spanner API. labels Mar 20, 2025
Add an option to specify the isolation level for a single transaction.
This isolation level overrides the current default isolation level that
has been set for the connection. This option only has an effect for
read/write transactions.
@olavloite olavloite force-pushed the isolation-level-per-transaction branch from 9cbacff to 9f88545 Compare March 20, 2025 13:54
@@ -100,6 +100,14 @@ public static AbstractStatementParser getInstance(Dialect dialect) {
}
}

static final Set<String> ddlStatements =
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These statements have been moved up in this file to make sure that they are executed before the static block on line 151.

Base automatically changed from default-isolation-level-connection-api to main March 28, 2025 09:56
@olavloite olavloite merged commit 868f30f into main Mar 28, 2025
33 of 34 checks passed
@olavloite olavloite deleted the isolation-level-per-transaction branch March 28, 2025 11:46
svc-squareup-copybara pushed a commit to cashapp/misk that referenced this pull request Mar 31, 2025
| Package | Type | Package file | Manager | Update | Change |
|---|---|---|---|---|---|
|
[com.google.cloud:google-cloud-spanner](https://github.com/googleapis/java-spanner)
| dependencies | misk/gradle/libs.versions.toml | gradle | minor |
`6.89.0` -> `6.90.0` |

---

### Release Notes

<details>
<summary>googleapis/java-spanner
(com.google.cloud:google-cloud-spanner)</summary>

###
[`v6.90.0`](https://github.com/googleapis/java-spanner/blob/HEAD/CHANGELOG.md#6900-2025-03-31)

##### Features

- Add default_isolation_level connection property
([#&#8203;3702](googleapis/java-spanner#3702))
([9472d23](googleapis/java-spanner@9472d23))
- Adds support for Interval datatype in Java client
([#&#8203;3416](googleapis/java-spanner#3416))
([8be8f5e](googleapis/java-spanner@8be8f5e))
- Integration test for End to End tracing
([#&#8203;3691](googleapis/java-spanner#3691))
([bf1a07a](googleapis/java-spanner@bf1a07a))
- Specify isolation level per transaction
([#&#8203;3704](googleapis/java-spanner#3704))
([868f30f](googleapis/java-spanner@868f30f))
- Support PostgreSQL isolation level statements
([#&#8203;3706](googleapis/java-spanner#3706))
([dda2e1d](googleapis/java-spanner@dda2e1d))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 6pm every weekday,before 2am
every weekday" in timezone Australia/Melbourne, Automerge - At any time
(no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Never, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://github.com/renovatebot/renovate).

GitOrigin-RevId: a63885015974acb6061bae5ca3b9d61136991376
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the googleapis/java-spanner API. size: l Pull request size is large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants