I have created a demo application to understand the C# SqlTransaction
.
I have a table Region
, and I have developed a Windows Forms application that starts two threads:
THREAD 1:
- Start a transaction.
- Insert a record.
- Sleep for 60 seconds
- Commit the transaction.
THREAD 2
- Start the transaction.
- Update any old record
- Commit the transaction.
Here because thread one's transaction is sleeping fro 60 seconds, thread two's transaction have to wait.
Is there any other way or isolation level by which I can do this INSERT and UPDATE together?