Saving Process

Topics: CAB & Smart Client Software Factory
Jul 30, 2004 at 10:07 AM
originally posted by: webman

Here I go again! :)

I understand the concept of how you put the data into the queue, and get it to the web services, but I would like a suggestion on how I should approach updating my cached object.

My object that is cached is actually a hierarchical collection of custom objects that is cached in one big chunk. The demo used 'refWorkItem.AcceptChanges()'. That is great for a dataset, but I am not using a dataset.

Here is a brief outline of how the object that is cached looks:

Custom obj 1
custom obj 2
custom obj 2
custom obj 3
custom obj 4
Custom obj 1
custom obj 2

etc..

If I update custom obj 4 under the 1st custom obj, and that has to be reflected in the cache, what would be the best approach? Or should I attempt to store each object in the cache seperately, and what approach should I try to do that? I am not sure if I could get each object into it's own cache, because of the way my code is, not the OAB.

Thanks,
Brad
Jul 31, 2004 at 12:10 AM
originally posted by: bbutton

If I understand your question correctly, the answer is that the cache is only updated on the granularity of the objects stored in it, but you get to decide how granular to make those objects. As I recall, AcceptChanges is there to tell the cache that it should clear out some housekeeping stuff for the data being stored, so being a DataSet or not shouldn't matter for it.

But what does happen is that your entire object graph is operated on at the same time, so if you update object4, cache1 needs to be stored into the cache again.

Did I understand and answer your question?

bab
Jul 31, 2004 at 6:24 AM
originally posted by: webman

I think I understand what you are saying. Right now I am stuck waiting on another application that mine depends on, and I can't run my app until they are done.

I will try to work things out next week, and see if I need anymore help.
Jul 31, 2004 at 7:16 AM
originally posted by: bbutton

Great, I'll be in Redmond next week, which means that I'm more available (fewer outside committments on the road :)).

The essence of what I was saying is that you can't buy just a piece of the pie. If you change any portion of something in the cache, you have to store the entire item back into the cache. We don't know anything about anything smaller, since it is entirely application-dependent.

bab