Open RIA Services User Support Issue : Multiple submit on DomainService when calling SubmitChanges on ONE insert  Viewed 24760 time(s), 4 post(s)., 1/13/2015 2:20:41 PM - by Waxalica

Waxalica
Waxalica 1/13/2015 2:20:42 PM

I am using version 4.3.0.0 of Open Ria Services and have a weird behavior when submitting changes on a single entity Insert.
My DomainService Insert Method is being called multiple times (7-8)...

This content has not been rated yet. 
20 Reputation 2 Total posts
1
ColinBlair
ColinBlair 1/13/2015 6:18:48 PM

That is not a failure mode I have heard of before. To begin with, I would start with a tool like Fiddler to see what is being sent to the DomainService. What I am interested in knowing is if there are multiple rows in the changeset, or if the DomainService itself is being called multiple times.

This content has not been rated yet. 
1539 Reputation 130 Total posts
2
Waxalica
Waxalica 1/13/2015 7:15:09 PM

I use a brand new ObjectContext, inserting the entity to be added, then proceeding to SubmitChanges (using a TaskCompletionSource to provide await/async pattern -- Upgrading to 4.4.0.0 is absolutely not an option)

Using Fiddler confirms that : Single entity being sent, entity being saved successfully (I'm checking the context to see if it has not been inserted already, to bypass the multiple insert call), but the service sends a 504 error ([Fiddler] ReadResponse() failed: The server did not return a response for this request. Server returned 0 bytes)

I'm using Ria Services on SL Client 5


I cannot check wether other insert methods have the same problem (over 50 tables), but previous calls to SubmitChanges (in a SaveSingleAsync extension method) on other entities don't show that error.

This content has not been rated yet. 
20 Reputation 2 Total posts
3
ColinBlair
ColinBlair 1/16/2015 6:45:19 PM

I am curious why you can't update to 4.4.0.0 although I don't know if it would make any difference.

The code is pretty straightforward in the DomainService. It does a foreach looping through everything in the ChangeSet calling the appropriate CUD method. Have you looked in the DomainService's ChangeSet to see if there are multiple entries there? I would put breakpoints in other places in the DomainService to see if they are being called multiple times as well. For example, how often is PersistChangeset getting called? You can add an override to see that. Otherwise, if you can provide more source code or a sample project I can see if I can find what is happening.

This content has not been rated yet. 
1539 Reputation 130 Total posts
4