如何处理WCF服务大数据? [英] How to handle large data in wcf service?

查看:97
本文介绍了如何处理WCF服务大数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Web应用程序调用WCF的方法来从数据库获取数据,但它是非常大的数据。这需要时间,在这段时间整个应用程序挂起针对特定用户,用户无法在Web应用程序做任何事情。
任何人都知道如何处理这种情况?难道这涉及到WCF节流,例如模式或线程呢,请让我知道如何处理这样的情况下,当我们需要从数据库中选择非常大的数据,需要将其绑定到一些GridView控件在非常大的数据的情况下,需要较长时间和到期时间发生异常。是否有介绍如何在WCF服务处理这些情况的任何好文章或链接。

Web application calls a wcf method to get data from DB, but it's very big data. It takes time, during this time whole application hangs for that particular user, user is not able to do anything in web application. Anybody knows how to handle this case? Is this related to wcf throttling, instance mode or threading?And please let me know how to handle such cases when we need to select very big data from DB and need to bind it to some gridview In case of very big data, it takes long time and time expiration exception occurs. Is there any good article or link which describes how to handle these scenarios in WCF service.

推荐答案

您已经问了不少问题,它能够更好地提出一个具体的问题。

You've asked quite a few questions, its better to ask one specific question.

应用程序挂起

如果该应用程序是Windows窗体,然后使用访问Web服务的BackgroundWorker 或一个新的异步 WebClient的方法。通过使用不同的线程的UI将不会挂。

If the application is Windows Forms, then access the Web Service using a BackgroundWorker or one of the new async methods in webClient. By using a different thread the UI will not hang.

如果该应用程序的JavaScript,然后用阿贾克斯为同一目的。

If the application is javascript, then use Ajax for the same purpose.

选择大数据

转换你的Web Service到繁琐的接口。代替请求数据的1M行,每次询问仅一个页面。你也可以使用无限滚动是pre-获取下一个页面的背景。

Convert you Web Service to a chatty interface. Instead of requesting 1M rows of data, ask for only a page at a time. You could also employ infinite scrolling that pre-fetches the next page in the background.

WCF实例模式

只有当同时请求正在向服务器发出这会影响速度。

This affects speeds only when simultaneous requests are being made to the server.

这篇关于如何处理WCF服务大数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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