首页 新闻 会员 周边

WCF+Nhibernate关于“基础连接已经关闭: 连接被意外关闭”的问题

0
悬赏园豆:50 [待解决问题]

我的WCF中使用NHibernate做数据访问,当添加了主外键的关系映射(bag)后,就会报错。错误如下:
Inner Exception:基础连接已经关闭: 连接被意外关闭。
   在 System.Net.HttpWebRequest.GetResponse()
在 System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)

PS:我已经将所有的.hbm.xml映射class中的lazy设置成false了。 

请问有遇到这种问题的吗?谢谢

问题补充:

错误提示:

基础连接已经关闭: 连接被意外关闭。

Server stack trace:    在 System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWebRequest request, HttpAbortReason abortReason)    在 System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)    在 System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)    在 System.ServiceModel.Channels.ClientReliableChannelBinder`1.RequestClientReliableChannelBinder`1.OnRequest(TRequestChannel channel, Message message, TimeSpan timeout, MaskingMode maskingMode)    在 System.ServiceModel.Channels.ClientReliableChannelBinder`1.Request(Message message, TimeSpan timeout, MaskingMode maskingMode)    在 System.ServiceModel.Channels.ClientReliableChannelBinder`1.Request(Message message, TimeSpan timeout)    在 System.ServiceModel.Security.SecuritySessionClientSettings`1.SecurityRequestSessionChannel.Request(Message message, TimeSpan timeout)    在 System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)    在 System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)    在 System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)    在 System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]:    在 System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)    在 System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)    在 ISystemManageService.QueryLogList(String hsql)    在 SystemManageServiceClient.QueryLogList(String hsql)

Inner Exception: 基础连接已经关闭: 连接被意外关闭。    在 System.Net.HttpWebRequest.GetResponse()    在 System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)

marin的主页 marin | 初学一级 | 园豆:114
提问于:2014-08-14 17:33
< >
分享
所有回答(3)
0

你得看服务器上的异常内容是什么。

Launcher | 园豆:45045 (高人七级) | 2014-08-14 17:35
0

关闭数据上下文的ObjectTrackingEnabled属性,设置其属性为false.

晓菜鸟 | 园豆:2594 (老鸟四级) | 2014-08-14 18:31
0

用这个http://msdn.microsoft.com/zh-cn/library/ms732023.aspx#中国 (简体中文)

记录日志一看就清楚了

喵喵喵猫 | 园豆:1742 (小虾三级) | 2014-08-15 16:59
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册