NHibernate in WebApi2 - issues with updates and de

2019-03-06 17:59发布

问题:

insert into,select all work correctly. when i update the data ,it not update to the sql server(as no sql exec to server,in the server is the old data not be updated). but when select to this record,it return the updated data has been updated. after i restart the iis server , sql server return the old data not be bu updated by selecting .

回答1:

Unfortunately you are not showing the problematic code in your question, but my guess is that you should review your handling of sessions and transaction.

Consider reviewing the quick start chapter of the NHibernate reference, particularly the notes on using and committing transactions. Also read the chapter on Manipulating Persistent Data.