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” />

Posted Thursday, June 26th, 2008 at 8:08 pm
Filed Under Category: Uncategorized
Responses are currently closed, but you can trackback from your own site.

0

Comments are closed.