Ploblem with Da.Fill(Ds):Concurrency

  • Thread starter Thread starter Jorge Maganto
  • Start date Start date
J

Jorge Maganto

Hi!
I'm building a site in ASP.NET which makes a query that
return 50.000 results, this result is read by
a DataAdapter to a DataSet (myDataAdter.Fill(myDataSet)).
The problem is if the query is made by two users at the
same time, the second user take a error.
The problem is that 'Fill' internal uses a DataReader and
only one DataReader can be opened at the time,
and when the 2 users open the DataReader (internal to
Fill) throw a exception.
How can read the results in other way, without use Fill or
DataReader?

Thanks in advance.
 
Hi Jorge,

Isn't 50000 results a bit too much for asp.net app?
Anyway, create a connection (with the same connection string) per thread (or
per logical process) IOW don't use the same connection object in multithread
applications.
As you've noticed, only one DbDataReader can be active on the same
conneciton instance at the same time.
 
Miha, Thank you very much!!

-----Original Message-----
Hi Jorge,

Isn't 50000 results a bit too much for asp.net app?
Anyway, create a connection (with the same connection string) per thread (or
per logical process) IOW don't use the same connection object in multithread
applications.
As you've noticed, only one DbDataReader can be active on the same
conneciton instance at the same time.

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com




.
 
Back
Top