SqlClient calls causing “Thread was being aborted at SNINativeMethodWrapper.SNIPacketGetConnection(IntPtr packet)”

心已入冬 提交于 2019-12-05 07:56:18

I believe I have resolved the problem. The offending line of code in the example above was the statement...

 Logging.DebugEvent.Raise(Me.GetType.Namespace, Reflection.MethodBase.GetCurrentMethod().Name, _
                                 "Report data recieved from database")

This is a call to a Application Block (MS enterprise library) for logging events to flat files (in this case) or event logs.

This one, in between the ExecuteXMLReader() and the actual usage of the reader in the XML document, was sometimes failing harshly, causing the whole thread to abort. I moved the line to after the _xmlReader.Close() and it took care of the problem.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!