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

feat: support bit-reversed sequences on the emulator #984

Merged
merged 6 commits into from
Mar 28, 2024

Conversation

olavloite
Copy link
Contributor

Bit-reversed sequences require the use of a read/write transaction. Hibernate starts a second read/write transaction when it needs to fetch new identifiers, and this transaction is aborted when it is running on the emulator. The PooledBitReversedSequenceGenerator now solves this by rolling back that transaction after getting the sequence values. This is semantically equivalent to committing the transaction, as the state of the sequence is durably changed regardless whether the transaction is committed or rolled back.

Fixes #983

Bit-reversed sequences require the use of a read/write transaction.
Hibernate starts a second read/write transaction when it needs to
fetch new identifiers, and this transaction is aborted when it is
running on the emulator. The PooledBitReversedSequenceGenerator
now solves this by rolling back that transaction after getting the
sequence values. This is semantically equivalent to committing the
transaction, as the state of the sequence is durably changed
regardless whether the transaction is committed or rolled back.

Fixes #983
Base automatically changed from fix-ddl-registration-for-json to master March 28, 2024 12:24
@olavloite olavloite merged commit 2e56037 into master Mar 28, 2024
7 checks passed
@olavloite olavloite deleted the rollback-bit-reversed-sequence-transactions branch March 28, 2024 12:30
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.

Bit-reversed sequences cannot be used with the emulator
1 participant