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

HHH-18818 Fix ID conflicts between CTE batch inserts and PooledOptimizer sequence allocation #9232

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

stringintech
Copy link
Contributor

@stringintech stringintech commented Nov 10, 2024

This PR resolves an ID conflict in Hibernate's CteInsertHandler batch insert implementation when using sequence-based ID generation with the PooledOptimizer. The issue arises from a misalignment between the batch insert ID generation strategy and the PooledOptimizer strategy, which can lead to ID conflicts.

The fix ensures that CteInsertHandler correctly integrates with the PooledOptimizer's ID allocation strategy by properly handling the next database-generated sequence value as the "hi" value, thereby maintaining consistent ID allocation across all insert operations.

A unit test (CteInsertStrategyWithPooledOptimizerTest) is included to validate the fix.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license
and can be relicensed under the terms of the LGPL v2.1 license in the future at the maintainers' discretion.
For more information on licensing, please check here.


https://hibernate.atlassian.net/browse/HHH-18818

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.

1 participant