Maximizing throughput while minimizing blocking

macuxpcmacuxpc Member Posts: 16
edited 2013-07-26 in SQL Performance
If you have a long-running process in NAV that is causing excessive blocking of users, you can use a stored procedure to detect blocking, and prevent/minimize it:

http://www.dynamics-nav.org/?p=100
MacUxPC
Dynamics-NAV.org

Comments

  • rmv_RUrmv_RU Member Posts: 119
    It looks like a new blocking implementation in Nav :). I think SQL Server do it better.
    In my opinion the only way to prevent and minimize blocking is Nav code optimization.


    PS. Now I always protect critical code from unexpected COMMIT like this:
      IF ProcIsBlocking() THEN BEGIN
        COMMIT;
        Dialog.UPDATE(3,'Sleeping due to blocking...');
        SleepTime := 20; //20 seconds
        FOR s := 1 TO SleepTime DO BEGIN
           Dialog.UPDATE(4,s / SleepTime * 10000);
          SLEEP(1000);
        END;
      END;
    
    Looking for part-time work.
    Nav, T-SQL.
  • macuxpcmacuxpc Member Posts: 16
    rmv_RU wrote:
    It looks like a new blocking implementation in Nav :). I think SQL Server do it better.
    In my opinion the only way to prevent and minimize blocking is Nav code optimization.

    I'm not sure you understand the purpose of this. How is SQL Server doing this better, when you import let's say 5,000 Sales Orders during the day? Your users will experience heavy blocking and likely many timeouts (i.e. errors). No matter how much you optimize the Sales Order import, you will get lots of blocking.
    MacUxPC
    Dynamics-NAV.org
  • rmv_RUrmv_RU Member Posts: 119
    macuxpc wrote:
    I'm not sure you understand the purpose of this. How is SQL Server doing this better, when you import let's say 5,000 Sales Orders during the day? Your users will experience heavy blocking and likely many timeouts (i.e. errors). No matter how much you optimize the Sales Order import, you will get lots of blocking.
    I see you point. But i'm not sure that all of 5.000 orders will be imported just in time with 20 seconds sleeping timeout and massive users input. On the other hand, this implementation decreases blocking time only if you have more than 1 order in importing queue at the moment.
    That's why i prefer configure schedule of import and optimize the code.
    Looking for part-time work.
    Nav, T-SQL.
  • pdjpdj Member Posts: 643
    Hi macuxpc,

    I wrote a comment on the 23rd, and it is still awaiting moderation :?
    Any reason you don't accept my comment on your blog?
    Regards
    Peter
Sign In or Register to comment.