Hi,
As per your description and your code I have understand that
1. Your server exceeds the max request limit. (Reason)
2. You have used Transaction while Insert * (
The Killer)
3. You are handling a quite a big code block for random access purpose.( Paradigm
Transaction will lock the table until it end its work and when we call commit it will marge data from its transaction log to final Table. So till one operation ends we already have some 100-300 request pending for same table and as time pass rest of requests are going to Timeout and Server became busy and you get a error of
403[
^].
Now how to eliminate that.
Before I proceed something you must admin every system has its own capability to perform so it will perform till it can or able.
Why we required Transaction ? If your SQL raise some kind of data related error it will rollback the operation else it will commit it.
You can provide validation before going to insert the data where you have fear to raise error.
Create a
Staging Table first insert data to that after validation and run some asynchronous job to move data from staging to Final.
It will give you at least 60%-70% performance increase.
Now to save a wide range of people
WCF[
^] is more better approach as you are going for multiple device types then REST Full Service will be appropriate.
here Is nice article to start with REST service :
Create RESTful WCF Service API: Step By Step Guide[
^]
Thanks,
Suvabrata