I have C# windows application.When 'Button 1' click in 'Form 1' I have a process that written data to few tables. That process normally taking 10 minutes. When one user click that 'Button 1' , another user who using same DB and program clicking another button in another form which inserting data to same tables.
When Button 1 clicking I'm starting the SQL Transaction and commiting that after finish the process.
Problem is when running that process, 2nd user getting a time out error and he can't complete his process.
What can I do for this? When SQL transaction starting is thet locking the tables which using for the process?
What can I do for this?
Rework your transaction handling. Seriously.
That process normally taking 10 minutes
A 10 minutes transaction is not practical by any means. I fail to see any reason for this outside bad comceptionalization - and I am doing database work for maybe 20 years all in all. Never tolerated and had a real need for transactions that long, normally there is a way around it.
Yes, you could change a timeout, but that means user 2 staring at the screen for 15 minutes. Not a real solution.
Rework your transaction from a logical point of view. What the heck do you do there that takes 10 minutes to start with?