TransientObjectException after upgraded to Hibernate core 6.6.15.Final

We were trying to upgrade to Hibernate Core 6.6.15.Final and encountered the following exception while attempting to save a record:

org.hibernate.TransientObjectException: persistent instance references an unsaved transient instance of 'com.entityName' (save the transient instance before flushing)

After investigating, I found that this issue is likely related to the following change:
:backhand_index_pointing_right: clean up logic in CHECK_ON_FLUSH 路 hibernate/hibernate-orm@8686392 路 GitHub

And I noticed a similar issue discussed here:
:backhand_index_pointing_right: Instance save transient before

However, the workaround suggested in that discussion would be difficult to apply across our codebase and could cause significant disruption as We have 500 plus hbm.xml files

Is there any other recommended configuration or workaround to handle this issue more gracefully?
Also, do you know if Hibernate plans to address or improve this behavior in any upcoming releases?

There is nothing to improve. You have to manage both sides of your associations, then you won鈥檛 have any exceptions.

Hi everyone.

This is the first time I post and I know I will not be welcome but I do wanted to say something: I think it鈥檚 reckless to force to manage both sides of an association. If you remove an element of the N side of the relation it should never involve the management from the 1 side. It feels like an atrocious decision.

Best regards

In the past, I was trying to defend the stance that changing just the owning side of an association should be enough, and that the inverse side should be ignored, but since downstream projects like Hibernate Search and Envers depend on data being in sync, it鈥檚 best that everyone who uses Hibernate just keeps the models in sync.
The easiest solution to do that is, not allow e.g. collection mutations directly, but always go through dedicated methods e.g. addChild()/removeChild() that will manage the inverse side as well.