为什么只有一些用户会收到错误消息:“连接正忙于另一个命令的结果” [英] Why only some users get the error: "Connection is busy with results for another command"

查看:125
本文介绍了为什么只有一些用户会收到错误消息:“连接正忙于另一个命令的结果”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Delphi应用程序,该应用程序使用来自DevArt的SDAC组件连接到SQL Server数据库,我们安装了200个软件,并且只有一个客户和一些用户发现了以下错误:

I have a Delphi Application that is connected to a SQL Server db using SDAC component from DevArt, we have 200 installations of the software and only to a customer, with some users, I notice the following error:

连接正忙于另一条命令的结果 = consioneèoccupata dai risultati di un altro comando。

SQL版本。:启用了文件流完整的SQL Server 2008 R2 Express

SQL vers.: SQL Server 2008 R2 Express with filestream full enabled

我的应用程序创建db用户和SQL帐户登录:

My application create both db users and SQL account logins:


  1. 创建新用户,那么就没有问题

  2. 更改应用程序中的用户代码,这意味着创建了另一个数据库用户和SQL帐户登录,我遇到了错误

  3. 此问题仅在部分用户而非全部用户中发生

我已经尝试过的没有运气的东西:

What I've already tried without luck:


  1. 已删除并重新安装的数据库

  2. 已卸载并重新安装的S QL服务器实例

  3. 检查SQL Server中的用户/帐户属性(都可以)

如果您需要具体信息,请告诉我

If you need specific infos please tell me

------------新信息------------

------------NEW INFORMATIONS------------

我从Studio Management更好地检查了所有实例属性,并且我注意到未检查CPU(请参见下图)。

I checked better all the Instance properties from Studio Management and I've noticed that CPU's are not checked (see image below).

在SQL Server的所有其他正常安装中,我看到已填充的复选框。
可能是问题吗?

Instead in all the other normal installations of SQL Server, I see filled checkboxes. Could it be the problem?

我希望这可以帮助您...

I hope this help you to help me...

推荐答案

连接正忙于另一个命令的结果错误意味着至少有两个查询使用相同的连接。如果您在多个线程中使用一个连接,则会出现此问题。若要解决这种情况下的问题,您应该在每个线程中都有连接(TMSConnection组件)。
此外,如果将TCustomMSDataSet.FetchAll属性设置为False,则可能会出现此问题。当FetchAll = False时,执行此类查询将阻止当前会话。为了避免阻塞,OLEDB创建了其他会话,该会话可能导致连接正忙于另一个命令的结果错误。要解决这种情况下的问题,应将TMSConnection.Options.MultipleActiveResultSets属性设置为True。 MultipleActiveResultSets属性启用对SQL Server多个活动结果集(MARS)技术的支持。它允许应用程序每个连接具有一个以上的待处理请求,尤其是每个连接具有多个活动的默认结果集。请注意,MultipleActiveResultSets属性仅在使用SQL Native Client时有效。因此,还应该将TMSConnection.Options.Provider属性设置为prNativeClient。

The "Connection is busy with results for another command" error means that there are at least two queries that use the same connection. This problem can occur if you are using one connection in several threads. To solve the problem in this case, you should have connection (the TMSConnection component) in each thread. Also, this problem can occur if you set the TCustomMSDataSet.FetchAll property to False. When FetchAll=False, execution of such queries blocks the current session. In order to avoid blocking OLEDB creates additional session that can cause the "Connection is busy with results for another command" error. To solve the problem in this case, you should set the TMSConnection.Options.MultipleActiveResultSets property to True. The MultipleActiveResultSets property enables support for the SQL Server Multiple Active Result Sets (MARS) technology. It allows applications to have more than one pending request per connection, and, in particular, to have more than one active default result set per connection. Please note that the MultipleActiveResultSets property works only when SQL Native Client is used. Therefore, you should also set the TMSConnection.Options.Provider property to prNativeClient.

这篇关于为什么只有一些用户会收到错误消息:“连接正忙于另一个命令的结果”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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