开发者

DbConnection Pool Error (Microsoft.Win32.SafeNativeMethods.ReleaseSemaphore)

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:

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._ThreadPoolWaitCallba开发者_如何学Pythonck.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)


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


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.

HTH

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜