locked
Retrieve Multiple strange behaviour RRS feed

  • Question

  • Hi folks,

    I have a very strange issue with a CRM 2011 windows service application.

    Occasionally, retrieve multiple returns no results, when there is certainly one record created (recently created let’s say 2-3 seconds ago) matching the filter expression.

    Could that be due to the transaction isolation level, since we enabled snapshot mode.

    Tuesday, March 17, 2015 11:22 AM

Answers

  • Snapshot Isolation Mode could theoretically cause this, but only if the RetrieveMultiple is within a SQL transaction that started before the created record was committed to the database. As your code is running as a windows service application, you cannot create SQL transaction across method calls, so it's actually unlikely that the RetrieveMultiple is within a SQL transaction that started earlier.

    How are you determining the 2-3 second gap ? Could it that you're recording the time that's reported by different servers, and that their clocks are out of sync ?


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

    • Marked as answer by Rinshwind Tuesday, March 17, 2015 12:40 PM
    Tuesday, March 17, 2015 11:35 AM
    Moderator

All replies

  • Snapshot Isolation Mode could theoretically cause this, but only if the RetrieveMultiple is within a SQL transaction that started before the created record was committed to the database. As your code is running as a windows service application, you cannot create SQL transaction across method calls, so it's actually unlikely that the RetrieveMultiple is within a SQL transaction that started earlier.

    How are you determining the 2-3 second gap ? Could it that you're recording the time that's reported by different servers, and that their clocks are out of sync ?


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

    • Marked as answer by Rinshwind Tuesday, March 17, 2015 12:40 PM
    Tuesday, March 17, 2015 11:35 AM
    Moderator
  • Hi David, thank you for the fast reply. 

    Your answer is what I was looking for. 

    It's not a clock issue. It turned out that the "Index out of range" exception was thrown because of a missing option set value, instead of missing related record as I incorrectly assumed .

    Thanks again.

    Tuesday, March 17, 2015 12:40 PM