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: run Spring Data JPA sample on the Emulator #2245

Merged
merged 2 commits into from
Aug 31, 2024

Conversation

olavloite
Copy link
Collaborator

Modifies the Spring Data JPA sample to (also) run on the Spanner Emulator. This was previously not possible, as the use of bit-reversed sequences in Hibernate also requires the backend to support 'concurrent' transactions. That is: When using bit-reversed sequences or other auto-generated primary keys, Hibernate will do the following:

  1. Start a transaction for the application and try to insert/update data in that transaction.
  2. If a new auto-generated ID is required, start a separate transaction to generate a batch of identifiers.

The above would not work on previous versions of the emulator, as the second transaction could not be started. The latest version of the emulator supports this.

This change also adds a test run for the sample application to the standard presubmit checks.

Fixes #2155

Modifies the Spring Data JPA sample to (also) run on the Spanner Emulator.
This was previously not possible, as the use of bit-reversed sequences in
Hibernate also requires the backend to support 'concurrent' transactions.
That is: When using bit-reversed sequences or other auto-generated primary
keys, Hibernate will do the following:
1. Start a transaction for the application and try to insert/update data
   in that transaction.
2. If a new auto-generated ID is required, start a separate transaction to
   generate a batch of identifiers.

The above would not work on previous versions of the emulator, as the
second transaction could not be started. The latest version of the
emulator supports this.

This change also adds a test run for the sample application to the
standard presubmit checks.

Fixes #2155
@olavloite olavloite merged commit 6ef07b4 into postgresql-dialect Aug 31, 2024
43 checks passed
@olavloite olavloite deleted the run-spring-data-jpa-sample-on-emulator branch August 31, 2024 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

spring-data-jpa sample does not work on emulator and does not have a test
1 participant