Re: ContextSwitchDeadlock
- From: "William \(Bill\) Vaughn" <billvaRemoveThis@xxxxxxxxxx>
- Date: Tue, 25 Apr 2006 13:11:57 -0700
Have you tried to access the two data sources with a Linked Server approach
that lets SQL Server do all of the processing?
--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
"OldButStillLearning" <OldButStillLearning@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote
in message news:E2D8FB44-DA7A-4629-80BE-C804D86D8F08@xxxxxxxxxxxxxxxx
Hello, I am getting this "ContextSwitchDeadlock" error message pop up in
situations where I am doing a Data Reader loop, where I am processing
about
40,000 records. For each record read via the data reader, I am creating
another data reader to read another database table (can't join these
tables -
on different machines) to get additional information. I am guessing that
I
am getting this error message becuase the loop is taking longer the 60
seconds to complete. Here is what is said about the error
"The most probable cause is that a single-threaded apartment (STA) thread
is
not pumping messages. The STA thread is either waiting without pumping
messages or is performing lengthy operations and is not allowing the
message
queue to pump."
I'm sorry, but I do not have a clue as to what this means. The other
probable cause is a process is consuming too much memory. Not sure That
this
would apply to me but perhaps opening and closing 40,000 data readers is
sucking up memory, although I would have expected the garbage collector to
have released this memory, but perhpas because it is all within the same
paragraph, the memory is not being release. I often just cancel out of
the
error message and continue with the process and it completes successfully,
so
I don't think it is a memory issue.
If I do not run in debug mode, I get the same error message running in
"Release" mode.
I read that you can turn off the MDA errors via the config file, but this
does not seem to me to be the appropriate solution to the problem... Does
it?
Any ideas or suggestions?
Thanks in advance for your assistance!!!!
.
- Prev by Date: Re: Compare Datarows
- Next by Date: Re: returning SCOPE_IDENTITY() in Insert command with C# DataSets
- Previous by thread: Compare Datarows
- Next by thread: Re: ContextSwitchDeadlock
- Index(es):
Relevant Pages
|