locked
Deadlock on PrincipalObjectAccess indexes RRS feed

  • Question

  • Hi,

    I am using CRM 2011 / UR5 and we're facing a problem where we have a plugin that is executed several times at once. The plugin revoke and grant share access to records. The plugin runs fine if executed once but we get a Generic SQL Error if the plugin is executed several times. Using the SQL profiler, I was able to find that the problem is caused by a deadlock on indexes of the PrincipalObjectAccess table. The two keys involved are cndx_PrincipalObjectAccess and UQ_PrincipalObjectAccess. I am aware of solutions to avoid deadlocks for retrieves but I haven't found anything related to how to fix indexes-related deadlocks. 

    Marc

    Tuesday, July 9, 2013 3:16 PM

All replies

  • following exception could happen when you are trying to grant share access to records.

    Violation of UNIQUE KEY constraint 'UQ_PrincipalObjectAccess'. Cannot
    insert duplicate key in object 'dbo.PrincipalObjectAccess'.

    that means records are already shared with that user/team, you can't again grant share access to that user/team.

    Friday, December 13, 2013 8:45 PM