Open RIA Services User Support NullReferenceException when CreateChangeSet called  Viewed 29931 time(s), 5 post(s)., 6/2/2014 10:46:15 AM - by ROBALEXCLARK

ROBALEXCLARK
ROBALEXCLARK 6/2/2014 10:46:15 AM

Hi,

I see the following error quite a lot in our error logs (probably 10 times a day out of 600 daily users):

Exception: OpenRiaServices.DomainServices.Client.SubmitOperationException: Submit operation failed. Object reference not set to an instance of an object.

Stack Trace:

at OpenRiaServices.DomainServices.Hosting.ChangeSetProcessor.CreateChangeSet(IEnumerable`1 changeSetEntries)

at OpenRiaServices.DomainServices.Hosting.ChangeSetProcessor.Process(DomainService domainService, IEnumerable`1 changeSetEntries)

at OpenRiaServices.DomainServices.Hosting.SubmitOperationBehavior.SubmitOperationInvoker.InvokeCore(Object instance, Object[] inputs, Object[]& outputs)

Any ideas on what might be causing this? I've never been able to repeat the bug unfortunately, but one common theme is that it only occurs after the application is left idle for an hour or more. I thought it was a timeout issue but my aspx session timeouts are set to 3 days!

Thanks,

Robin

This content has not been rated yet. 
76 Reputation 9 Total posts
1
ColinBlair
ColinBlair 6/3/2014 1:31:44 PM

Looking at the code, the only way I could see that error happening is if a Submit request hit the server with a null set of changes. That isn't anything I have seen happen before, but your thought of something timing out after being idle sounds likely. It would probably be the application pool, not your aspx session, that timed out. Are these WCF logs that you are seeing the error in? If you have the message itself logged it would be interesting to see if the submit message looks correct.

This content has not been rated yet. 
1539 Reputation 130 Total posts
2
ROBALEXCLARK
ROBALEXCLARK 6/3/2014 2:16:05 PM

Hi Colin,

Thanks for looking into this. I've tried to reproduce the error on my dev box by doing both a recycle and an iisreset but to no avail. I've added the following checks before SubmitChanges to try and catch an empty changeset over the next few days:

<p>
EntityChangeSet changeSet = chroniclesDomainContext.EntityContainer.GetChanges();
            if (changeSet.IsEmpty)
                throw new InvalidOperationException("ChangeSet is Empty!");
            else if (!changeSet.GetChangeSetEntries().Any())
                throw new InvalidOperationException("There are no ChangeSet entries!");
</p>

They are not in the WCF trace logs - there are no errors relating to this that I can see, but as far as I can tell this error occurs before any service call is made (?). The errors come from the App.Application_UnhandledException event where I email the call stack to myself.

This content has not been rated yet. 
76 Reputation 9 Total posts
3
ColinBlair
ColinBlair 6/3/2014 4:15:01 PM

The stack trace is showing server side code, not client side code. ChangeSetProcessor only exists in the server, it isn't one of the classes that exists on both sides, so you must be hitting the service.

This content has not been rated yet. 
1539 Reputation 130 Total posts
4
ROBALEXCLARK
ROBALEXCLARK 6/5/2014 2:47:55 PM

Well the extra code I put in to catch any funnies didn't trigger and I'm still getting a few errors. I did re-examine the svc trace logs and eventually tracked down the error in the logs but it didn't tell me anything new.

This content has not been rated yet. 
76 Reputation 9 Total posts
5