Collection was modified; enumeration operation may not execute. error on DataPortal.Execute #3698
Unanswered
kobi-shanti
asked this question in
Questions
Replies: 1 comment 2 replies
-
We've found a few semi-related posts in the CSLA forum archives and we're starting to believe this error is due to CSLA not being threadsafe. Are we on the right track here? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We have a WinForms application that is running CSLA v5.5.3. We've recently implemented an IIS application server, running a remote CSLA data portal using .NET Core 3.1.
Since our move to 3-tier, we have been experiencing intermittent errors whilst calling DataPortal.Execute for one of our CommandBase-derived commands. The error that is produced is "Collection was modified; enumeration operation may not execute.".
Through some testing and error trapping we believe the error is generated on the client side of the data portal, meaning it is not tied to the code in our command's [Execute] method. We think the error is occurring as a result of simultaneous calls to DataPortal.Execute being made from different threads in our application (main GUI thread and background thread associated with a timer) as this is the only time it appears to be occurring.
We've confirmed the error only occurs in 3-tier.
Does anyone have any ideas or potential solutions? Is this a known issue?
Let me know if I can provide further information to clarify our scenario.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions