Sporadic Arg_COMException in Silverlight when loading data from RIA service
Asked Answered
S

1

6

Users sometimes get strange exception while working with application. I could not ever reproduce it. It happens when executing one particular domain service query. This query gets executed quite often (each time user saves changes).

Query does not have parameters. There is simple filtering: Context.GetEventsQuery().Where(lce => lce.Id > maxId)

Domain service method is simple: public IQueryable GetEvents() { return ObjectContext.Events; }

After it happens first time, it keeps happening every time (until user refreshes the webpage).

Here is exception text from logs: Load operation failed for query 'GetEvents'. System.ServiceModel.DomainServices.Client.DomainOperationException: Load operation failed for query 'GetEvents'. ---> System.Exception ---> System.Exception: [Arg_COMException] Arguments: Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=4.0.50917.0&File=mscorlib.dll&Key=Arg_COMException at System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult) at System.Net.Browser.BrowserHttpWebRequest.<>c__DisplayClass5.b__4(Object sendState) at System.Net.Browser.AsyncHelper.<>c__DisplayClass2.b__0(Object sendState) --- End of inner exception stack trace --- at System.ServiceModel.DomainServices.Client.WebDomainClient`1.EndQueryCore(IAsyncResult asyncResult) at System.ServiceModel.DomainServices.Client.DomainClient.EndQuery(IAsyncResult asyncResult) at System.ServiceModel.DomainServices.Client.DomainContext.CompleteLoad(IAsyncResult asyncResult) --- End of inner exception stack trace --- at System.ServiceModel.DomainServices.Client.OperationBase.Complete(Exception error) at System.ServiceModel.DomainServices.Client.LoadOperation.Complete(Exception error) at System.ServiceModel.DomainServices.Client.DomainContext.CompleteLoad(IAsyncResult asyncResult) at System.ServiceModel.DomainServices.Client.DomainContext.<>c__DisplayClass1b.b__17(Object )

What can be the reason?

Semiconscious answered 1/3, 2011 at 13:44 Comment(2)
Did you ever manage to fix this or get to the cause of this error? We're having it too, occasionally in our Silverlight front end.Calcium
I'm also seeing very sporadic evidence of users encountering this on a SOAP WS call. Any ideas as to what's causing this?Dotted
A
4

We had the same sporadic issue. Tracked it down to race condition where we were calling "load" on a domain data source more than once at the same time.

In our case we had written an attached behavior for the domaindatasource called "DurableDomainDataSourceBehavior". It's job was to catch failed loads, check if there was a communicationexception and if there was, wait a few seconds before attempting to load again. We found we had some flawed logic that was attaching multiple instances of the behavior to the same domaindatasource instance. When an end user hit a network related issue while loading each instance of the DurableDomainDataSourceBehavior would call load which resulted in the arg_ComException. The fix was to make sure we didn't attach multiple instances of the behavior to the same domaindatasource instance and to look for other spots in the code where we might be calling DomainDataSource.Load more than once at the same time.

I'm not sure if this is specific to the DomainDataSource or if it can be reproduced with a DomainContext on it's own. I was never able to reproduce the issue locally but I can confirm that since our fix it's no longer appearing in the logs.

Auerbach answered 2/10, 2012 at 18:3 Comment(2)
Thank you for the answer. I do not even work on that project and company, but your explanation makes sense, and we had unstable network, so it can be the case.Semiconscious
I was getting the same error message. In my case I was setting an expander's IsExpanded property to false, and this in turn was firing the _Collapsed event, wherein I was setting the visual state with VisualStateManager.GoToState sending true on useTransitions param. Changed that to false, and the error went awayKrakow

© 2022 - 2024 — McMap. All rights reserved.