System.InvalidOperationException on Dynamics CRM 2011 Plugin & Workflow

Today, I was facing a strange error on one of the custom workflow activity. The workflow when run in production environment was going into waiting state whenever there was two or more simultaneous execution.

Looking at the Systemjobs, it showed the following error

System.InvalidOperationException: Microsoft Dynamics CRM has experienced an error.
Exception: You cannot create a SqlExecutionContext from another SqlExecutionContext on which OnBeginRequest has not been called

Continue reading