WebApi2中的NHibernate-更新和删除问题 [英] NHibernate in WebApi2 - issues with updates and deletions

查看:73
本文介绍了WebApi2中的NHibernate-更新和删除问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

插入,选择所有工作正常. 当我更新数据时,它不会更新到sql服务器(因为没有sql exec到服务器,在服务器中是未更新的旧数据). 但是,当选择这种记录,返回更新后的数据已被更新. 重新启动iis服务器后,sql服务器返回的旧数据不会通过选择进行更新.

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 .

推荐答案

不幸的是,您没有在问题中显示有问题的代码,但是我猜测您应该检查会话和事务的处理方式.

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.

考虑查看NHibernate参考文献的快速开始一章 ,尤其是有关使用和提交交易的说明.另请阅读有关处理持久数据的章节.

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.

这篇关于WebApi2中的NHibernate-更新和删除问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆