Re: How to avoid deadlock while executing SQL Procedures

Home Page Forums BizTalk 2004 – BizTalk 2010 How to avoid deadlock while executing SQL Procedures Re: How to avoid deadlock while executing SQL Procedures

#21044

The best fix would be to modify the stored procedures so they can be run concurrently without deadlocking.  You can configure BizTalk to send the SQL messages one at a time, but the problem is that you could end up with a huge backlog of messages over time.  If the SP takes 12 minutes to run, and you receive messages every 5-8 minutes, something has to give.  Is there any window where you don’t receive the messages so that BizTalk will be able to finish processing the backlog?

To make BizTalk send the messages one at a time, here are some options:

1.  Mark the SQL send port for ordered delivery.  This should make the messages go through the port one at a time, forcing one message to complete before another one can begin.  I can’t remember whether this is done in the orchestration in VS, or on the physical send port through the BizTalk admin console.  Just check the settings both places.

2.  Use a sequential convoy pattern.  You would need to modify your orchestration to receive messages in a loop.  This would mean that you would only have one active instance of the orchestration and the orchestration would control the timing of the messages sent to SQL and you could avoid deadlocks.