Hosam Aly
Hosam Aly

Reputation: 42443

LINQ-to-SQL retrieving data from a different query!

I have a web application that uses LINQ-to-SQL. It has a very strange issue, where a LINQ command retrieves the data that is supposed to be returned by another, totally different query that runs in a different thread. What could be the cause of this?

Specifically, a user accesses the application from his machine, opening a certain page. At the same time, another user accesses a different page from his (different) machine. One of the queries throws an exception, while the other returns the data of the first one, which comes from a very different table!

The case is always reproducible, whenever we stress the application with these two users. I've checked but I don't see any shared variables of any kind. What else could the problem be? What should I be looking for?

Your help is really appreciated.

Upvotes: 1

Views: 106

Answers (2)

Frank Tzanabetis
Frank Tzanabetis

Reputation: 2836

You sure this isn't a session issue rather than a linq issue? Data requested from one asp.net session but passed over to another sounds like something's getting mixed up there.

Upvotes: 0

Lucero
Lucero

Reputation: 60190

Sounds like a connection is being reused. Make sure not to cache those and always create and release them properly, such as in this sample.

Upvotes: 1

Related Questions