26
Jun
Just got this error and to my astonishment it was my error! What a surprise.
I had a many-to-one property in a hibernate mapping and when I was calling saveOrUpdate I got the error: object references an unsaved transient instance - save the transient instance before flushing. Now the transient object was immutable - and my mapping said save it - fool!
To fix it I changed this:
<many-to-one name=”Class” column=”column_id” />
to this:
<many-to-one name=”Class” column=”column_id” update=”false” insert=”false” />
0