Friday, July 26, 2013

NHibernate.TransientObjectException : object references an unsaved transient instance - save the transient instance before flushing.

I came across this error recently and found the following on nhforge:

When a transaction is committed, the session is flushed to the database. That just means data changes are written to the database. This exception is telling us we’re trying to save an object, which is referenced another object that isn’t saved. We can infer that this means cascading is turned off for this relationship. 

Reference: http://nhforge.org/blogs/nhibernate/archive/2009/08/23/part-5-fixing-the-broken-stuff.aspx

No comments: