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:
clean up logic in CHECK_ON_FLUSH 路 hibernate/hibernate-orm@8686392 路 GitHub
And I noticed a similar issue discussed here:
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?