Hibernate 6.6.13.Final - ERROR AssertionFailure HHH000099

Hi ,

After migrating to Hibernate 6.6.13.Final from 5.6.x, we are seeing below errors. Same code was working fine before. Please note that it works after adding @Transactional annotation, which was not needed previously. Also if i apply below properties in my data-source config, it works fine without @Transactional. My issue is that i need to add @Transaction in 100+ places which i want to avoid now. Please suggest. It is complaining about oneToMany association which is “lazy” loading option.

ERROR AssertionFailure HHH000099: an assertion failure occurred (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session): org.hibernate.AssertionFailure: collection owner not associated with session

downgradeHoldCursorsUnderXa=true
resultSetHoldability=1

Hi All,
Can someone please provide more details regarding below? How to make it version 5 equivalent? Is there a property i can set?

In Hibernate 6, the behavior around “hold cursor” (specifically, the holdCursorBeforeUpdate property) has changed. In Hibernate 6, this property, by default, is no longer true. Hibernate 6 defaults to closing the cursor after the transaction. This change can affect applications that rely on maintaining a cursor open for updates or other operations.

Thanks