打开SQL连接时的算术溢出异常 [英] Arithmetic overflow exception when opening SQL connection

查看:82
本文介绍了打开SQL连接时的算术溢出异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

打开与基础SQL数据库的SQL连接时,我得到了一个很奇怪的 ArithmeticOverflowException (下面包括堆栈跟踪信息).使用哪个版本的服务器没有区别(我已经验证了MS SQL 2005/2008/2012/2014),错误仍然相同.从Windows Update安装的所有最新更新和补丁.操作系统为Windows 8.1/10(两个系统上均相同).服务器已本地安装,并且通过用户名和密码进行连接.验证连接超时的范围是15到1000秒.

I got very weird ArithmeticOverflowException when opening an SQL connection to the underlying SQL database (stack trace included below). It doesn't make a difference which version of the server is used (I've verified MS SQL 2005/2008/2012/2014), error is still the same. All the newest updates and patches from Windows Update installed. OS is Windows 8.1 / 10 (same occurs on both systems). Server is installed locally and the connection is made via user and password. Connection timeout verified in range from 15 to 1000 sec.

最令人惊讶的是,应用程序运行良好,并且可以与服务器正确通信,执行许多不同的查询,但是突然发生了这种异常.我注意到在某些Windows更新后开始出现此异常(不知道是哪个).

The most surprising thing is the application works just fine, and communicates with the server properly, executing many various queries, but suddenly this exception occurs. I noticed this exception started showing up after some windows update (no idea which one).

我已经研究了.NET代码,但是不知道是什么原因导致那里的算术溢出异常...

I've looked into the .NET code, but have no idea what can cause the arithmetic overflow exception there...

-堆栈跟踪-

in SNIOpenSyncExWrapper(SNI_CLIENT_CONSUMER_INFO* , SNI_ConnWrapper** )
in SNINativeMethodWrapper.SNIOpenSyncEx(ConsumerInfo consumerInfo, String constring, IntPtr& pConn, Byte[] spnBuffer, Byte[] instanceName, Boolean fOverrideCache, Boolean fSync, Int32 timeout, Boolean fParallel)
in System.Data.SqlClient.SNIHandle..ctor(ConsumerInfo myInfo, String serverName, Byte[] spnBuffer, Boolean ignoreSniOpenTimeout, Int32 timeout, Byte[]& instanceName, Boolean flushCache, Boolean fSync, Boolean fParallel)
in System.Data.SqlClient.TdsParserStateObject.CreatePhysicalSNIHandle(String serverName, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Byte[]& instanceName, Byte[] spnBuffer, Boolean flushCache, Boolean async, Boolean fParallel)
in System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean withFailover)
in System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover)
in System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout)
in System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance)
in System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData)
in System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
in System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)
in System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
in System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
in System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
in System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
in System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
in System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
in System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
in System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
in System.Data.SqlClient.SqlConnection.Open()

推荐答案

我遇到了同样的问题.Lavasoft也是一个原因.我在程序和功能"中检查是否有任何Lavasoft程序,但我惊讶地发现名为Lavasoft的WebCompanion应用程序.我还发现了一个正在运行的服务LavasoftTcpService.

I had the same problem. Lavasoft was also a reason. I checked in Program and Features if there is any Lavasoft program, and I was surprised to find application called WebCompanion of Lavasoft. I also found a running service LavasoftTcpService.

  1. 我停止了服务LavasoftTcpService(来自services.msc)
  2. 我从程序和功能"中卸载了WebCompanion.
  3. 上面提到的两个dll(C:\ Windows \ System32和C:\ Windows \ SysWOW64中的LavasoftTcpService.dll和LavasoftTcpService64.dll)仍然存在.我改了名字,问题消失了.

在执行这些步骤之前,我尝试仅更改dll名称,但存在一个解析本地主机的问题:系统正在寻找0.0.0.0,而不是127.0.0.1.Ping给我一个错误消息"Ping请求找不到主机localhost.请检查名称,然后重试".

Before those steps I tried to only change dlls names and there was a problem to resolve localhost: instead of 127.0.0.1 system was looking for 0.0.0.0. Ping was giving me an error message "Ping request could not find host localhost. Please check the name and try again"

3个步骤解决了这个问题.

3 steps resolved the problem.

这篇关于打开SQL连接时的算术溢出异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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