the CLR has been unable to transition from COM context...

Adagio

Well-known member
Joined
Dec 12, 2005
Messages
162
Programming Experience
Beginner
Why is it that when I run my application I get this error after some time:

The CLR has been unable to transition from COM context 0x1a1d60 to COM context 0x1a1ed0 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.

The application is a simple "convert from one database to another" application. After the click of the button it starts reading all the data from an Access database, when it is done it'll then save all data in the SQL-server.
The saving and loading works fine, but the program stops responding* at random times. It stops at random times from halfway through reading the data to halfway through saving the data. 60 seconds after it stops responding the above message is shown

*I have set the program to write in a label the ID number of the last loaded/saved data. At some point it stops increasing


I have tried to set the program to now throw an expection when this error occours (through // Debug // Exceptions), but that doesn't help
 
Back
Top