0

I have a small problem and I was hoping some of you guys have any experience with that. First of all I'm gonna explain what am I planning to acomplish.

I'm building a program for windows server working with local SQL Server DB (SQLEXPRESS 2008). I think it doesn't matter in my question, but it's gonna be written in C#.

This program is using this DB as a shared data holder between all of the win server users. That means one process for one user and that means one connection to SQL and DB for one user at the time.

And my question is. Imagine situation that one user is inserting something into this DB and exactly at the same time some other user wants to connect to this DB and read something. Is it gonna throw exception? Is it gonna wait on a queue? I really don't know and it's kind of hard to test this situation.

So If anybody has any idea, I would really appreciate it. Looked deep into google but couldn't find the answer for this.

Thanks in advance.

FossilMFC
  • 43
  • 1
  • 7

1 Answers1

1

The short answer is don't worry about it, SQL server manages this for you.

Some more details:
SQL uses transactions and locks. which means that queries or a batch of queries are being treated as atomic actions. resources will be locked while consumed by a client.

Typically this will not be noticed by users as the transactions are fast enough.

Avi Turner
  • 10,234
  • 7
  • 48
  • 75