Thursday, February 9, 2012

ASP.NET + SQLServer Data Mixup

I've created a ASP.NET site using a SQLServer database hookup, and after creating the project with minimal errors I have run into a major problem. The site is made to be used by multiple users using Update and Select commands at the same time, but I have found that, when multiple users are using the site at the same time, (20+) the data seems to be going to the wrong people.

For example, user 1 was recieving user 2's data. The code works fine with 1-5 users on at once, but seems to have this problem very frequently with more than that. The computers that were being used at the same time were all in the same room, under the same LAN domain, with very similar computer names (ABCD-101-XX where XX is the computer number). I was wondering if this could be the problem, if the computers are in escence waiting for their data, and just steal the first piece of data they can find.

This seemed to happen when the users were performing the same query at the same time, so the data was in the right place, it was just someone elses data.

Any help would be greatly appreciated.Are you storing any data in the Application state or in Cache? These locations are shared between all users and you will definitely get incorrect results. Do not ever share connection or command objects in a global fashion.|||No, I havent been storing any data in the Application state or in the Cache, so that cant be a problem. If anyone out there has experienced this problem before or may know of some sort of a way to fix this, any help would be greatly appreciated.|||A week later and this problem still exists, anyone have any sort of a solution??|||This isn't really a SQL Server/MSDE issue. You might have better luck in the Data Access forum.

And no, I've never seen this problem before, on any platform. My gut feeling is that it's a hardware/LAN issue.

Terri|||Could you share your code with us? I expecte there is concurrency problem in your
Update and Select commands

where I assume you didn't put these two statements within one transaction.

No comments:

Post a Comment