ContextSwitchDeadlock was detected - VB .Net


I have developed a VB .Net application that calls a Oracle stored procedure (l_cmdSetting.ExecuteNonQuery) which takes about 10 mins to complete and return focus to the application. During this time the app waits for the SP to complete and displays the message

"ContextSwitchDeadlock was detected
Message: The CLR has been unable to transition from COM context 0x1b0778 to COM context 0x1b08e8 for 60 seconds. The thread that owns the destination context/apartment is most likely either doing a non pumping wait or processing a very long running operation without pumping Windows messages. This situation generally has a negative performance impact and may even lead to the application becoming non responsive or memory usage accumulating continually over time. To avoid this problem, all single threaded apartment (STA) threads should use pumping wait primitives (such as CoWaitForMultipleHandles) and routinely pump messages during long running operations.

I need the SP to complete before carrying on with application processing.

1) What does this mean?
2) Can I ignore this issue?
3) Do I need to code a fix and if 'yes' what should this be?

Thanks Ian

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bob LearnedCommented:
This is a big problem, and really depends on a lot of different factors.  I usually get this error when I wait too long looking at code when the IDE is in break-mode.  

Another possibility is referenced in this article:

Why you sometimes get a bogus ContextSwitchDeadLock MDA under the debugger

It talks about debugging managed code that includes unmanaged code.

Here is another possibility:

contextSwitchDeadlock MDA


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Forced accept.

EE Admin
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.