Hibernate ActionQueue.sort() removes entities from insertion batches

Description

When committing transaction with batch insertions using SessionFactory, there is an error in ActionQueue.InsertActionSorter.sort(insertions), where could be some entities from batches removed. Lines 759 - 815 in Hibernate 5.2.10.Final. When in inner loop is called this.latestBatches.remove more than once, then some entity could have multiple occurence in this.latestBatches, other one could disappear.

Environment

None

Activity

Show:
Gail Badner
March 1, 2018, 6:09 AM

, there have been several bugfixes related to this in recent releases. Please let us know if this is still an issue using 5.2.14. If it is, then please attach a runnable test case that reproduces your issue. You can find test templates at: https://github.com/hibernate/hibernate-test-case-templates.

Nathan Xu
December 25, 2019, 4:18 PM

It seems has removed the double removing and replace it with single removing, so this ticket could have been fixed.

Assignee

Unassigned

Reporter

Martin Kožený

Fix versions

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Worked in

5.0.12

Components

Priority

Critical
Configure