We have about 7 app servers running .NET windows services that ping a single sql server 2005 queue table and fetch a fixed amount of records to process at fixed intervals. The amount of records to process and the amount of time between fetches are both configurable and are initially set to 100 and 30 seconds initially.
我们有大约7个运行.NET Windows服务的应用服务器,它们ping单个sql server 2005队列表并获取固定数量的记录以固定间隔进行处理。要处理的记录数量和提取之间的时间量都是可配置的,最初设置为100和30秒。
Currently, my queue table has an int status column which can be either "Ready, Processing, Complete, Error". The proc that fetches the records has a sql transaction with the following code inside the transaction:
目前,我的队列表有一个int status列,可以是“Ready,Processing,Complete,Error”。获取记录的proc有一个sql事务,事务中包含以下代码:
1) Fetch x number of records into temp table where the status is "Ready". The select uses a holdlock hint
1)将x个记录提取到临时表中,状态为“就绪”。 select使用holdlock提示
2) Update the status on those records in the Queue table to "Processing"
2)将队列表中这些记录的状态更新为“处理”
The .NET services do some processing that may take seconds or even minutes per record. Another proc is called per record that simply updates the status to "Complete". The update proc has no transaction as I'm leaning on the implicit transaction as part of the update clause here.
.NET服务会执行一些处理,每条记录可能需要几秒甚至几分钟。每个记录调用另一个proc,只是将状态更新为“完成”。更新proc没有事务,因为我在此处依赖于隐式事务作为update子句的一部分。
I don't know the traffic exceptions for this but figure it will be under 10k records per day.
我不知道这个流量异常但是数字不会超过每天10k的记录。
Is this the best way to handle this scenario? If so, are there any details that I've left out, such as a hint here or there?
这是处理这种情况的最佳方式吗?如果是的话,是否有任何我遗漏的细节,例如这里或那里的提示?
Thanks! Dave
谢谢!戴夫