DbConnection池错误(Microsoft.Win32.SafeNativeMethods.ReleaseSemaphore)

时间:2022-08-04 13:57:53

I am getting this error in my VB.NET code. Anyone have ideas on what it could be or how to troubleshoot. I am using SQL Server 2008 and this error doesn't happen consistently. Looks like it happens completely randomly and doesn't seem to be originating from my code:

我在VB中得到这个错误。NET代码。任何人都知道它可能是什么或者如何排除故障。我正在使用SQL Server 2008,这个错误不会一直发生。看起来它是完全随机发生的,似乎不是源自我的代码:

MESSAGE: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at Microsoft.Win32.SafeNativeMethods.ReleaseSemaphore(SafeWaitHandle handle, Int32 releaseCount, Int32& previousCount)
   at System.Threading.Semaphore.Release(Int32 releaseCount)
   at System.Data.ProviderBase.DbConnectionPool.PutNewObject(DbConnectionInternal obj)
   at System.Data.ProviderBase.DbConnectionPool.DeactivateObject(DbConnectionInternal obj)
   at System.Data.ProviderBase.DbConnectionPool.ReclaimEmancipatedObjects()
   at System.Data.ProviderBase.DbConnectionPool.PoolCreateRequest(Object state)
   at System.Threading._ThreadPoolWaitCallback.WaitCallback_Context(Object state)
   at System.Threading.ExecutionContext.runTryCode(Object userData)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallbackInternal(_ThreadPoolWaitCallback tpWaitCallBack)
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(Object state)

2 个解决方案

#1


1  

Seems like it's an issue with the object being disposed of or the reference has changed (memory pointer that is). Can you post any code?

似乎是对象被处理或引用被更改(即内存指针)的问题。你能张贴任何代码吗?

http://msdn.microsoft.com/en-us/library/ms685071(v=vs.85).aspx

http://msdn.microsoft.com/en-us/library/ms685071(v = vs.85). aspx

#2


0  

I read a blog once that the person had experienced a similar problem. They had upgraded from 32 to 64 bit and had not changed their build properties target platform. You might start there.

我曾经读过一个博客,说这个人遇到过类似的问题。他们已经从32位升级到64位,并且没有改变他们的构建属性目标平台。你可能会从这里开始。

HTH

HTH

#1


1  

Seems like it's an issue with the object being disposed of or the reference has changed (memory pointer that is). Can you post any code?

似乎是对象被处理或引用被更改(即内存指针)的问题。你能张贴任何代码吗?

http://msdn.microsoft.com/en-us/library/ms685071(v=vs.85).aspx

http://msdn.microsoft.com/en-us/library/ms685071(v = vs.85). aspx

#2


0  

I read a blog once that the person had experienced a similar problem. They had upgraded from 32 to 64 bit and had not changed their build properties target platform. You might start there.

我曾经读过一个博客,说这个人遇到过类似的问题。他们已经从32位升级到64位,并且没有改变他们的构建属性目标平台。你可能会从这里开始。

HTH

HTH