tags:

views:

82

answers:

1

Have anyone got an exception like this "ContextSwitchDeadLock" RANDOMLY in your program executions?

I have a query linq against an SQL CE source, a very simple one

From Entry in DataContext.Resources Select Entry Where Entry.Key = Key

-Key is of type String.

After I queried, whenever I try to iterate the results, the program gets stuck in the foreach Next... after a while it responds with a dialog telling me ContextSwitchDeadlock.

I have no answer to this. Google neither; this is too random to be debugged. And it happens to me other times, I didn't solve it, I just workaround it using ADO. But I'm really tired of getting this error without knowing what is really happening, and what I'm doing wrong that throws it.

Any help would be really appreciated

Regards

Javier

A: 

YES! And after much googling, I found this post, which seems to be talking about the same behavior (even though I'm not - and probably you're not - using Xceed's grid):

http://xceed.com/CS/forums/thread/20710.aspx

Xceed looked up the issue and believes it's due to a problem with the SqlCeConnection used by LINQ. There's a ticket for it here, where MS says it's fixed in the next version of SQL Server Compact (I think they mean 3.5 SP2, which is currently in beta):

https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=411912&wa=wsignin1.0

I didn't try it with the beta yet, but I do see that the problem goes away when I switch to SQL Server Express 2008.

Abby Fichtner