首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >wcf服务停止响应我认为这是因为应用程序没有关闭与wcf的连接

wcf服务停止响应我认为这是因为应用程序没有关闭与wcf的连接
EN

Stack Overflow用户
提问于 2012-02-16 16:38:19
回答 1查看 249关注 0票数 0

这不是我的周转基金服务,但我想修复它,我需要第二个意见这里是从silverlight打开服务的代码,我不能把所有的代码,因为这个项目是非常大的,我只是没有看到在所有项目中的一个m_MdxService.close(),我认为问题随机关闭,周转基金停止响应,唯一修复它的是回收应用程序池是因为银光没有关闭周转基金的对象。wcf服务正在其自己的应用程序池上运行。服务器为64位

代码语言:javascript
复制
 public abstract class CubeControl : Control, IFilter
    {
            protected MdxClient m_MdxService;
            protected GeneralClient m_GeneralService;
            protected PortalClient m_PortalService;
            protected ListsSoapClient m_PortalListsService;

     public GraphControl(string cubeName, SharedContract.Filters filter)
            : base(cubeName) 
        {
            AttachEvents();
            Init(filter); 
        }

 public override void UpdateGraph()
        {
            flipable.Visibility = Visibility.Collapsed;
            progressStackPanel.Visibility = Visibility.Visible;
            noDataStackPanel.Visibility = Visibility.Collapsed;

            DataPointEventArgs dpe;

            switch (m_DrillLevel)
            {
                case 0:
                    m_MdxService.GetGraphDataAsync(SharedContract.Enums.Query.NumberOfEmployees, Filter, null, null);
                    break;
                case 1:
                    dpe = m_DrillParam as DataPointEventArgs;
                     m_MdxService.GetGraphDataAsync(SharedContract.Enums.Query.NumberOfEmployeesYears, Filter, dpe.Key, null);
                    break;
                case 2:
                    dpe = m_DrillParam as DataPointEventArgs;
                    string temp = selectedYear + "," + dpe.Key.ToString();
                    m_MdxService.GetGraphDataAsync(SharedContract.Enums.Query.NumberOfEmployeesMonth, Filter, temp, null);
                    break;
            }
        }
     void InitServices()
            {
                m_MdxService = new MdxClient();

                m_MdxService.InnerChannel.OperationTimeout = new TimeSpan(0, 4, 0);

                m_GeneralService = new GeneralClient();

                m_GeneralService.InnerChannel.OperationTimeout = new TimeSpan(0, 4, 0);

                m_PortalService = new PortalClient();

                m_PortalService.InnerChannel.OperationTimeout = new TimeSpan(0, 4, 0);

                m_PortalListsService = new ListsSoapClient();

                m_PortalListsService.InnerChannel.OperationTimeout = new TimeSpan(0, 4, 0);
            }


      void AttachEvents()
            {
                m_MdxService.GetGraphDataCompleted += new               EventHandler<GetGraphDataCompletedEventArgs>(m_MdxService_GetGraphDataCompleted);
            }

            void m_MdxService_GetGraphDataCompleted(object sender, GetGraphDataCompletedEventArgs e)
            {
                GetGraphDataCompleted(sender, e);

                GetDataCompleted(this);
            }
    }
EN

回答 1

Stack Overflow用户

发布于 2012-02-16 18:10:58

而不是使用控制创建客户端,为什么不使用silverlight客户端为服务代理创建一个集中访问和创建点。

例如:

然后,在您的控制范围内,使用App.Current.MdxService..GetGraphDataCompleted.注册已完成的事件,并使用App.Current.MdxService.GetGraphDataAsync进行访问

这样,您就有了服务客户端的一个实例。

然而,我确实认为您的问题存在更深层次的问题,您需要找到应用程序池需要回收的根cause.If,在我看来,这肯定是其他原因。在托管服务的服务器上查看您的工作集的大小。可能是api导致了内存问题。如果它在900MB左右,并且appPool运行在32位模式下,你在服务器上就会有问题,如果64位模式,它将能够处理更多的tho。

也许可以考虑单独运行该服务。

希望助力干杯

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/9307940

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档