LazyInitializationException when "ordered_inserts=true"

Description

When "hibernate.order_inserts = true" and there is an entity been inserted with uninitialized associations it can result in a LazyInitializationException. As I could debug it happens in ActionQueue.findBatchNumber when it tries to find the batch number for an association resulting in a call to the entity hashCode method.

Maybe you could check if the association is initialized before trying to compute its batch number.

Environment

SqlServer

Activity

Show:
Brett Meyer
November 28, 2013, 10:18 AM

I'm 99% sure this area was reworked for similar issues, but the specific tickets escape me. Feel free to attach a test case if it's still an issue

Out of Date

Assignee

Unassigned

Reporter

Israel Rios

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major