I have a BO with an EditableChildCollection which typically has about 400 items in the collection. In a typical usage scenario the user will update a couple of items in the collection and then I do a save (which is actually on an auto-save timer).
Currently the save operation takes 3 to 4 seconds which is too long. 95% of this time is taken up by the Clone operation just prior to doing the save. Is there some way to get around this?
I have experimented doing the save without the clone and it is very fast, but I understand I will get caught out here if something fails during the save operation - leaving me with an invalid object.
I have chosen an editable child collection because I want to edit each record in a grid. I could of course make it an editable root collection but that wouldn't solve the problem as it is the collection that is taking a long time to clone.
Here's the situation. The user needs to record the registration of athletes for a race. 95% of the athletes have raced before and are on file. Currently they print the list of names from their database on a registration sheet, and simply write the race number next to each person's name as they present for registration. New athletes are added to the end of the list.
So I have provided them with an updatable grid as it best matches their current system. I tried to think of alternative approaches, but a grid is intuitive to use and minimises the use of the keyboard. Both of these are important factors as inexperienced users will be using the application, and the time taken (by the user) for each update is critical.
The only way I can see to avoid the large collection is to fall back to master-detail style approach, and use a read only collection with a single editable object. This would solve the 'clone' problem, but it is a compromise from a usability point of view.
I should point out that it is not the save operation that is slow - it is the clone that takes the time. Every time I save the parent only a couple of records actually result in a database update. If I save the current object directly performance is great.
I was thinking that maybe I could create a second collection that just contained the modified items, and then clone and save that. I would then have to move the saved items back into the original collection after the save. How does that sound?
Copyright (c) Marimer LLC