ManyToMany List update with detached entities throws EntityExistsException

Description

I know this is not a nice usage of Hibernate in general but we came across this issue during our Spring Boot migration (5.0.12 to 5.2.17)

Given an entity with ManyToMany list (not sure about ManyToOne ) updating the list with the same detached entities would cause an EntityExistsException.

Environment

5.2.17, Java8

Assignee

Chris Cranford

Reporter

Bahri Gencsoy

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Worked in

5.0.12

Components

Affects versions

Priority

Minor
Configure