"Switching to COM context for RuntimeCallableWrapper error" in parallel programming

I have several methods that invoke SP from SQL Server. In the user interface, I invoke methods using parallel programming, as shown below:

Parallel.Invoke( ()=>{value1=GetData1(filterCriteria); }, ()=>{value2=GetData2(filterCriteria); }, ()=>{value3=GetData3(filterCriteria); }, ()=>{GetData4(filterCriteria); } ); 

I ran into the error below.

"Switching to the COM context 0x4f0100 for this RuntimeCallableWrapper Error with the following error: System call failed. (Exception from HRESULT: 0x80010100 (RPC_E_SYS_CALL_FAILED)).
This is usually because the COM context is 0x4f0100, where this RuntimeCallableWrapper was created was disabled or busy with something else. Clearing interfaces from the current COM context (COM context 0x4f01b8). This may result in data corruption or loss. To avoid this problem, make sure that all COM / apartment / thread contexts remain alive and contextual while the application is fully executed using RuntimeCallableWrappers, which represents the COM components that live inside them. "

What is the possible reason and how to avoid this error? Please suggest.

+1
c # asynchronous parallel-processing
Apr 21 '16 at 11:34
source share

No one has answered this question yet.

See similar questions:

43
Conditions when, finally, are not satisfied in the .net try..finally block

or similar:

3
COM add-in: resolve DisconnectedContext error in WinWord.exe
3
DisconnectedContext was discovered - Threadpool and Ping
3
Error: DisconnectedContext was detected in asp.net c #
3
Disabled Context was detected C # clipboard
3
DisconectedContext has been detected
2
Getting error when creating Excel via C #: moving to COM context 0x56b098
one
"DisconnectedContext was detected" error when releasing Excel object in C #
one
Context 0x3c74b38 is disabled. The proxy server will not be used to service the request on the COM component.
0
Detected disconnectedcontext error in vs



All Articles