C# & ADO - Multi-threaded web app

X

Xataraxx

I'm somewhat new to C# & .Net, so pardon what might be a silly
question...

I'm in the process of building a web application that needs to make
pretty heavy use of a backend database (MySQL, if it matters).

Obviously the DB access needs to be thread-safe. Or at least I think
it does. Which is sort of my question...

The app will both read & write to the DB. Can multiple writes happen
concurrently? I would guess not, but I don't know for sure. How
about concurrent read operations?

If I do have to limit DB access to a single operation at a time, what
the most efficient mechanism for doing it?

I should probably note that the app is being developed using Visual
Studio 2003 & the .Net 1.1 Framework.

I'm not expecting anyone to write the code for me, I just need some
direction. :)
 
N

Nicholas Paldino [.NET/C# MVP]

MySql is a database server, so you don't have to worry about concurrency
issues. You will issue requests to the server and the server will worry
about handling the requests concurrently.

If you are sharing connections between threads and things of that
nature, my advice to you is don't, as you aren't really gaining anything.

Once you get the data into a dataset, you can share that among threads,
but you have to worry about concurrency issues when accessing it.

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top