Caleb Jares
Caleb Jares

Reputation: 6307

NHibernate flush/save/update does not persist

When I try to update an entity, no matter what I do, it will not update. I've tried calling ISession.SaveOrUpdate(), ISession.Merge(), ISession.Flush(), etc. The session shows that the object is updated, but manually querying the database shows that the updates were not persisted.

Upvotes: 0

Views: 392

Answers (2)

Willy David Jr
Willy David Jr

Reputation: 9171

This happens to me, fortunately, changing the mutable settings fix it from:

Mutable(false);

I just removed it:

//Mutable(false);

Upvotes: 1

Caleb Jares
Caleb Jares

Reputation: 6307

If you are using the hbm.xml format, double check that your .hbm.xml file does not contain mutable="false" in the <class> declaration. If it is there, then you can persist your object to the database, but any updates will opaquely fail.

Upvotes: 0

Related Questions