order_inserts: StackOverflowError when flushing a session

Description

The fix for "HHH-12074 - order_inserts: flush during transaction causes incorrect insert ordering and subsequent constraint violation" added a "parent" field to BatchIdentifier, to sort entries.
However, the current code does not account for scenarios with cross-linked entities.

I've attached a ORMUnitTestCase sample.
It works with 5.2.12.Final.
It fails with 5.2.13.Final and later versions.

Environment

None

Activity

Show:
Vlad Mihalcea
April 17, 2018, 7:05 AM

Tested it on master and with 5.2.17 and the issue does not replicate. Check out this test case for a proof.

Assignee

Davide Massarenti

Reporter

Davide Massarenti

Fix versions

None

Labels

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Worked in

5.2.12

Components

Affects versions

Priority

Major
Configure