GoogleCloudPlatform / pgadapter

PostgreSQL wire-protocol proxy for Cloud Spanner
https://cloud.google.com/spanner/docs/postgresql-interface#postgresql-client-support
Apache License 2.0
54 stars 20 forks source link

docs: run Spring Data JPA sample on the Emulator #2245

Closed olavloite closed 2 weeks ago

olavloite commented 2 weeks ago

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