locked
CRM 2013 - Deadlocks due to internal update queries? RRS feed

  • Question

  • Hello,

    Recently we have upgraded our CRM 4 to CRM 2013. We have around 600 users using it. We are monitoring database performance through one tool and observed coupe of deadlocks due to following internal queries:

    Query 1: Updating QuoteNumber counter in OrganizationBase table

    update OrganizationBase set @currentval = CurrentQuoteNumber, CurrentQuoteNumber = CurrentQuoteNumber + 1 where OrganizationId = @orgid

    Query 2: Updating OrderNumber counter in OrganizationBase table

    update OrganizationBase set @currentval = CurrentOrderNumber, CurrentOrderNumber = CurrentOrderNumber + 1 where OrganizationId = @orgid

    I don't know what will be impact due to these deadlocks because I have found counters are updated correctly till now and all quotes and orders have unique number, so no data issue.

    My questions are,

    1) Have anybody noticed such issue?

    2) Any customizations (like plugins/workflows) creates such issues in internal queries? -

    Thursday, April 23, 2015 6:11 AM

All replies

  • I've never seen this issue - though the number generation process is robust, in that you'll always get unique numbers

    Custom plugins wouldn't directly affect this, but can have an indirect effect by increasing the duration locks are held on the OrganizationBase table. This could happen if you have plugins running within the transaction (stages 20 or 40) either on the create message of the quote or order entity, or on other messages where the plugin creates quotes or orders. Note that this also applies to the quotedetail and salesorderdetail entities if the quote or order is created from an opportunity or quote


    Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk

    Thursday, April 23, 2015 9:12 AM
    Moderator
  • Thanks David.

    OrganizaionBase is separate table so it should not getting lock. Not sure why this is happening.

    Thursday, April 23, 2015 9:45 AM