Intermittent System.IndexOutOfRangeException when reading a field from IDataReader

那年仲夏 提交于 2019-12-05 17:58:14

I would guess that you are sharing instances of a datareader between threads. Make sure that DB.GetRS is returning a new instance of a datareader in all cases, and not returning a shared instance.

CaptainBli

So after much searching, I come across your post with the exact problem that I have. I show the posting around to my friends here at work and they acknowledge that this is our case. Then I realize that there is not enough information here to solve my problem. So I took some of what is said here and searched some more.

I came across this posting: Index Out Of Range Exception. It is a good post not just for NHibernate.

I added Pooling=false; to my connection string in my web.config and then started a series of tests to load the server down. We tested to 200% of our current max visitor load to try to kill the server with this error. Previously, we would crash at below 100%. There was not a single error. I will test the other option which was Enlist=false. I haven't heard of this before.

One further note, we have been running AspDotNetStoreFront for several years. So I went back to find out why our latest website release was having all of these errors and the old site didn't have the errors. Turns out we had added pooling=false; previously to great success.

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