Last post Apr 09, 2018 11:23 PM by DA924
None
0 Points
1 Post
Apr 09, 2018 12:30 PM|Dinesh___|LINK
'public void mypostfunction() { //call Webapi post method here }' --using this code to sent multiple request a time. 'for (int i=0; i< count; i++) { new Thread(() => { Thread.CurrentThread.IsBackground = true; mypostfunction(); }).Start(); }' --Webapi Route Method '[Route("example/mypostfunction/")] [System.Web.Http.HttpPost] public async Task<HttpResponseMessage> Examplepost(Getvaues value) { }'
All-Star
52201 Points
23284 Posts
Apr 09, 2018 01:15 PM|mgebhard|LINK
What is the actual error? Can you post the SQL code that causes the error?
This code pattern is a problem. mypostfunction() should be async.
for (int i=0; i< count; i++) { new Thread(() => { Thread.CurrentThread.IsBackground = true; mypostfunction(); }).Start(); }
Contributor
4873 Points
4123 Posts
Apr 09, 2018 04:44 PM|DA924|LINK
How do you know that you are getting a SQL Deadlock on a table?
2 Posts
Apr 09, 2018 10:07 PM|amansiotheking|LINK
I have no idea, really, but if anyone knows how to solve this, let them comment, it is in the interest of many of us. big thanks
Apr 09, 2018 11:23 PM|DA924|LINK
amansiotheking I have no idea, really, but if anyone knows how to solve this, let them comment, it is in the interest of many of us. big thanks
https://docs.microsoft.com/en-us/sql/connect/jdbc/understanding-isolation-levels
https://docs.microsoft.com/en-us/sql/t-sql/queries/hints-transact-sql-table
None
0 Points
1 Post
I get sql deadlock error came using webapi post method. how to handle multiple request at a time...
Apr 09, 2018 12:30 PM|Dinesh___|LINK
All-Star
52201 Points
23284 Posts
Re: I get sql deadlock error came using webapi post method. how to handle multiple request at a t...
Apr 09, 2018 01:15 PM|mgebhard|LINK
What is the actual error? Can you post the SQL code that causes the error?
This code pattern is a problem. mypostfunction() should be async.
Contributor
4873 Points
4123 Posts
Re: I get sql deadlock error came using webapi post method. how to handle multiple request at a t...
Apr 09, 2018 04:44 PM|DA924|LINK
How do you know that you are getting a SQL Deadlock on a table?
None
0 Points
2 Posts
Re: I get sql deadlock error came using webapi post method. how to handle multiple request at a t...
Apr 09, 2018 10:07 PM|amansiotheking|LINK
I have no idea, really, but if anyone knows how to solve this, let them comment, it is in the interest of many of us.
big thanks
Contributor
4873 Points
4123 Posts
Re: I get sql deadlock error came using webapi post method. how to handle multiple request at a t...
Apr 09, 2018 11:23 PM|DA924|LINK
https://docs.microsoft.com/en-us/sql/connect/jdbc/understanding-isolation-levels
https://docs.microsoft.com/en-us/sql/t-sql/queries/hints-transact-sql-table