I submit hundreds of infopath forms in a short amount of time using SourceCode.Workflow.RuntimeServices.Client.InfoPathService.SubmitInfoPathData. This eventually causes timeout errors, I guess not surprisingly. If you watch the console, you'll see errors like this:
Error 0 lProcInstCreate
Info 1020 Starting Session 05085B555F0C553BC31B4B5234BBA902
Error 1 Cannot insert duplicate key row in object 'dbo._ProcInst' with unique
index 'IX_ProcInstID'.
- To get out of this, I run the K2 stored procedure [dbo].[wipeinst].
- To prevent this, I'm adding a sleep time of 2 minutes in between each automatic submit to K2. This seems to give my automated process time to move through the K2 processes and not overload the server.
This seems hacky, so please post if you have run into this and\or you have a better way of preventing it.