This is my first post so please be gentle! I am writing an application to keep track of appointments. An editable root list is bound to the schedule. I am using the version just before 3.5. My problem is that there may be 350 objects on the schedule and my save is slow. I am using remoting. My question is, when a list of 350 objects contains 2 objects that are dirty, how much of the list is transferred over the WAN to save those 2? Does it transfer the list to the remoting site then execute Save() on the 2 dirty objects? If so how would you recommend I deal with this?
Code is like this:
//say this returns 500 objects
Appointments a = Appointments.GetAppointments(some criteria data);
//then through the course of operations say 2 get updated
.........
//now we save
a.ApplyEdit();
//this call goes to some www. remoting portal
a = a.Save();
Please help!
Thanks.
Liza
Liza,
The thing to remember when remoting is that anything that happens inside a DataPortal_XXX method is happening on the server. It is likely that your list is being transferred to the server before being saved. Do you have a check in the DataPortal update to check if the objects are dirty?
So my question is "How would you handle it?". Assume we have 500 items in a read write root list. Of those 500, 4 are dirty. If when using Remoting the whole list is sent to the server and then saved, How could we get out those two, save, and remerge? them into the original list elegantly? Is that even what I should do? I could brute force it but I figure you guys being the experts, you probably have already dealt with this.
Thanks in advance!
Liz
I have used a technique similar to the one Stefan explains and it did work.
You might want to do a bit of experimenting before you go down that route to see if your performance problem really is with the transmission over the wire or with the database update. You could write some tests to compare the time taken to do a save when 4, 10, 40, 100, all the objects in the list are dirty. If you see the length of time taken increasing roughly in proportion to the number of dirty objects then your bottleneck is to do with writing to the database rather than moving the list to the server.
If you would like a quick test to see how large objects are
(which would affect transmission time), you can use BinaryFormatter (which is
what remoting is using) to serialize your object graph to a file and see what
file size is.
Sergey Barskiy
Senior Consultant
office: 678.405.0687 |
mobile: 404.388.1899
Microsoft Worldwide Partner of the Year | Custom
Development Solutions, Technical Innovation
From: RikGarner
[mailto:cslanet@lhotka.net]
Sent: Friday, April 11, 2008 10:45 AM
To: Sergey Barskiy
Subject: Re: [CSLA .NET] List Save is Slow
I have used a technique similar to the one Stefan explains and it
did work.
You might want to do a bit of experimenting before you go down that route to
see if your performance problem really is with the transmission over the wire
or with the database update. You could write some tests to compare the time
taken to do a save when 4, 10, 40, 100, all the objects in the list are
dirty. If you see the length of time taken increasing roughly in proportion to
the number of dirty objects then your bottleneck is to do with writing to the
database rather than moving the list to the server.
Copyright (c) Marimer LLC