When the save button is clicked, the following code is run [PersistenceSession is a property returning an ISession instance]:
_storedWill = PersistenceSession.Load<StoredWill>(_storedWillId);
_storedWill.WillReference = txtWillReference.Text;
_storedWill.IntroducerReference = txtIntroducerReference.Text;
//A stack of other properties of the _storedWill object assigned
PersistenceSession.SaveOrUpdate(_storedWill);
A breakpoint set on the final line reveals that PersistenceSession.IsDirty() is true.
However, no update SQL is generated. Can anyone think why?
Thanks
David
You need to
Flushthe session to have the updates sent to the database.SaveOrUpdatewill not send anything to the database unless you are persisting a newly-created entity, whose ID values are database generated. Since you are just updating, all this does is ensures that the_storedWillentity is associated with theISessionreturned by thePersistenceSessionproperty.