Skip to content
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

docs: support concurrent transactions on the emulator #1601

Merged
merged 1 commit into from
May 4, 2024

Conversation

olavloite
Copy link
Collaborator

@olavloite olavloite commented May 4, 2024

Documents the support for overlapping transactions on the emulator in the Connection API, even when these are executed on one thread. This is normally not supported, as it requires multiple transactions to run concurrently on the emulator.

This change works around that by keeping track of what the active transaction on the emulator is, and then abort that transaction when another transaction needs to make progress. The transaction that was aborted will be retried up to the point where it was when it again wants to make progress.

This step-by-step progress is implemented by automatically setting a savepoint in the transaction after each successful step. The transaction is then rolled back to that savepoint when another transaction needs to make progress.

The feature is only enabled if the autoConfigEmulator flag is enabled.

Adds support for overlapping transactions on the emulator in the Connection API, even when these are executed on one thread. This is normally not supported, as it requires multiple transactions to run concurrently on the emulator.

This change works around that by keeping track of what the active transaction on the emulator is, and then abort that transaction when another transaction needs to make progress. The transaction that was aborted will be retried up to the point where it was when it again wants to make progress.

This step-by-step progress is implemented by automatically setting a savepoint in the transaction after each successful step. The transaction is then rolled back to that savepoint when another transaction needs to make progress.

The feature is only enabled if the autoConfigEmulator flag is enabled.
@olavloite olavloite requested a review from a team as a code owner May 4, 2024 08:05
@product-auto-label product-auto-label bot added size: xs Pull request size is extra small. api: spanner Issues related to the googleapis/java-spanner-jdbc API. labels May 4, 2024
@olavloite olavloite changed the title feat: support concurrent transactions on the emulator doc: support concurrent transactions on the emulator May 4, 2024
@olavloite olavloite changed the title doc: support concurrent transactions on the emulator docs: support concurrent transactions on the emulator May 4, 2024
@olavloite olavloite merged commit 7123991 into main May 4, 2024
23 of 26 checks passed
@olavloite olavloite deleted the concurrent-transactions-on-emulator branch May 4, 2024 08:08
gcf-merge-on-green bot pushed a commit that referenced this pull request May 4, 2024
🤖 I have created a release *beep* *boop*
---


## [2.18.0](https://togithub.com/googleapis/java-spanner-jdbc/compare/v2.17.1...v2.18.0) (2024-05-04)


### Features

* Allow DDL with autocommit=false ([#1600](https://togithub.com/googleapis/java-spanner-jdbc/issues/1600)) ([a61c25d](https://togithub.com/googleapis/java-spanner-jdbc/commit/a61c25d8f90460ec507b383dbaee0ca686104ba8))
* Support concurrent transactions on the emulator ([#1601](https://togithub.com/googleapis/java-spanner-jdbc/issues/1601)) ([7123991](https://togithub.com/googleapis/java-spanner-jdbc/commit/71239912a8078569dcd985314810131e593c0ed7))


### Bug Fixes

* ClassCastException in Spring Data JDBC sample ([#1595](https://togithub.com/googleapis/java-spanner-jdbc/issues/1595)) ([e96a86a](https://togithub.com/googleapis/java-spanner-jdbc/commit/e96a86a4b82ac4b47bd1ce25e810f01299597339))


### Dependencies

* Update dependency com.google.cloud:google-cloud-spanner-bom to v6.66.0 ([#1599](https://togithub.com/googleapis/java-spanner-jdbc/issues/1599)) ([84ea11a](https://togithub.com/googleapis/java-spanner-jdbc/commit/84ea11ac27635dbe6fb101134767d14488dde8c2))
* Update dependency com.google.cloud:sdk-platform-java-config to v3.30.0 ([#1597](https://togithub.com/googleapis/java-spanner-jdbc/issues/1597)) ([40a7212](https://togithub.com/googleapis/java-spanner-jdbc/commit/40a721237c79882e55d86d48402c64cc09782522))
* Update dependency org.mybatis.dynamic-sql:mybatis-dynamic-sql to v1.5.1 ([#1596](https://togithub.com/googleapis/java-spanner-jdbc/issues/1596)) ([f54beb2](https://togithub.com/googleapis/java-spanner-jdbc/commit/f54beb20d6bbe3f4974385c4758ba77d31d25ce3))

---
This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
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-jdbc API. size: xs Pull request size is extra small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant