I was able to install the Breeze.Sharp ToDo project. I noticed a behavior while adding a new todo item. When a new todo item is added, the server call SaveChanges is made by the client and the item is added successfully. The client again has to call the server by QueryAllTodos to get the latest list again. Why this round trip is necessary? Isn't the SaveChanges method supposed to merge the changes (the new list after the addition) with the client list to avoid this round trip again?
Asked
Active
Viewed 105 times
1 Answers
1
You are correct. There is no real need to requery after a save UNLESS there is some other server side "side-effect" ( say a trigger) that also changes the data. This code is just playing it safe.

Jay Traband
- 17,053
- 1
- 23
- 44
-
Since you mentioned about the side effect, does Breeze.Sharp handle the concurrency issue gracefully? For example, when an order is saved, a trigger calculates the individual shipping cost of the order line item and saves it immediately in the same table. Another example is two users are updating the same customer details. When one user A saves the customer details, the other user B already saved his changes, so user A's customer data become stale and a concurrency issue comes up. – wonderful world Jul 16 '14 at 21:21
-
Providing you have defined concurrency columns in your model, breeze will always check these on every update that it performs and will raise a concurrency exception if the entity has been updated by another process. – Jay Traband Jul 16 '14 at 21:28
-
The re-query is not strictly necessary. It's included partly because it is traditional for Todo apps to re-query after save and partly to pick up additional changes that might have been made by some other user. That's my excuse and I'm sticking to it. :-) – Ward Jul 17 '14 at 17:25