NHibernate - not-null property reference a null or transient value?

Another possibility is that you're saving an entire object graph, and that graph is circular, and items cannot be null. You could be giving NHibernate no legal order in which to do the inserts. (It should produce a better error message, but it produces this one).

I've had this problem recently and it has to do with the way NHibernate bi-directional relationships are persisted. You have the mapping correct and therefore NHibernate will perform the Patient insert no problem. Then NHibernate needs to take the key from Patients and cascade that into Insurances.

Since the Patient does not yet exist, the keys do not exist and it cannot perform the second insert. The key is to set the relationship via code prior to persistence, something like this.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions