在WCF服务调用中处理5000条记录的批次 [英] Processing Batch of 5000 Record in WCF Service Call

查看:84
本文介绍了在WCF服务调用中处理5000条记录的批次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的要求是在WCF服务中公开一个新的操作联系人,该联系人具有处理能力并在数据库中保存大约3000至5000条记录的批处理,并返回该批处理中每条记录的uniqueId(数据库ID)?


谁能告诉我该功能的方法或示例?

My requirement is to expose a new operation contact in WCF service which has capability to process and save a batch of around 3000 to 5000 records in database and return uniqueId(database id) of each and every record in the batch?


Can anyone tell me the approch or sample for this functionality?

推荐答案

取决于单个记录的平均大小,您可能无法将这么多的信息传递给服务.

如果是我,我会写一个Web方法来接受1-to-n记录",因此我可以调整代码中的负载.使在任何给定时间可以通过的最大可能记录100(或您喜欢的任何数字),并开始使用该方法(在测试环境中)以查看会发生什么.

我不确定为什么要真正返回插入记录时生成的ID,但是,我有一个陌生人的请求.只需将它们返回为XML字符串即可.
Depending on the average size of a single record, you may not be able to pass that much info to a service.

If it were me, I''d write a web method that accepted 1-to-n "records", so I can adjust the load in my code. Make the max possible records you can pass at any given time 100 (or whatever number you''re comfortable with), and start hitting the method (in a test environment) to see what happens.

I''m not sure why you''d want to actually return the ID''s that were generated when the records were inserted, but hey, I''v had stranger requests. Just return them in a XML string.


这篇关于在WCF服务调用中处理5000条记录的批次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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