Reattaching entity with one-to-many lazy list mapped collection can update index column

Description

Repro steps:

  • Have an Entity with a lazy loaded list

  • Load the Entity in a transaction and initialize the list

  • Close transaction and save the reference to detached object

  • Merge the object in a new transaction and do not touch the collection

  • OrderColumn will be updated after commit of second transaction

I belive the problem is in OneToManyPersister and org.hibernate.collection.internal.PersistentList.Clear (Persister seems to shift items when a clear operation is queued)

Environment

Java 1.8.66
Windows 8 64
PostgreSQL 9.2

Status

Assignee

Unassigned

Reporter

Ivan Korhner

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

5.0.9

Priority

Blocker
Configure