CFanatic

Go Back   CFanatic > Programming > C# Programming

Join CFanatic Forum Now

How to get rid COM context error topic posted under C# Programming which is a part of Programming category in CFanatic Forum
Reply
 
Thread Tools Display Modes
  #1  
Old 09-01-2010, 12:23 PM
 
Join Date: Sep 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
livehed is on a distinguished road
| More
How to get rid COM context error

Hi,

Am working on a windows form application which uses interop to call a COM dll. I keep getting this error in the app method where the flow is like this:

1.Fetch about 7 records[R] from database 2.For each of this record,app instantiates a COM class using Interop and does some processing/calculation using the same. 3.Then the app fetches about 750 records for each of this record R. 4.App then updates back data in database for each record in step 3.

ContextSwitchDeadlock was detected
Message: The CLR has been unable to transition from COM context 0x1c8be8 to COM context 0x1c8a78 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.
FYI, I'm using System.Runtime.InteropServices.Marshal.ReleaseComO bject to release the COM object instance. Any idea, how to get rid of this?Please suggest.

Thanks.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Unit Test Fails, throws COMException "There is no MTS object context" doglin82 C# Programming 0 09-01-2010 11:13 AM
send filename by the Right-Click send to context menu SimonB26 C# Programming 0 08-28-2010 03:00 AM
error: fortune2k C# Programming 0 08-28-2010 03:00 AM
Windows Shell Context Menu 95ulisse Shell Scripting 0 03-28-2010 09:35 AM
segmented error?? rati C Programming 5 09-12-2006 09:23 AM

 

Advertisement

CFanatic Search
Custom Search

Advertisement

All times are GMT -5. The time now is 04:53 PM.



Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO ©2010, Crawlability, Inc.
Cfanatic.com is a premier member of the IDG TechNetwork. For advertising opportunities contact here
Get Paid for Working on Projects Matching Your Expertise at Go4Expert's Jobs Board