Hello,
We found out that simple fetch xml query bellow was locking the database. The fetchxml bellow was found in the SQL as the head blocking process 4 times in 1 hour. Blocks were ranging from 2 mins, 28 mins, 38 mins and up to 57 mins.
Nothing seems unusual in the Execution plan of the query, looks normal, very little data is passed.
Calling this from a C# plugin which is reading little data, one or two rows of data, nothing special, just creates one record in the CRM 8.2 on prem.
Plugin runs only once, is synchronous and is registered on preOperation.
Has anyone else experienced such scenario and solved it?
Answers will be highly appreciated
<fetch output-format='xml-platform' mapping='logical' distinct='false'>
<entity name='entity1'>
<attribute name='attribute1' />
<attribute name='attribute2' />
<order attribute='attribute1' descending='false' />
<filter type='and'>
<filter type='or'>
<condition attribute='attribute1' operator='eq' value='someValue' />
<condition attribute='attribute1' operator='eq' value='someValue' />
</filter>
</filter>
<link-entity name='entity2' from='entity2id' to='entity2id' alias='ent'>
<filter type='and'>
<condition attribute='attribute3' operator='eq' value='{id}' />
</filter>
</link-entity>
</entity>
</fetch>