I have a TreeGrid that has cacheAllData set to true and noticed that the first time I reparent a node Smart Client issues a single "update" operation to the server, but on the second and following times I reparent a node it issues a "fetch" operation immediately followed by the "update" operation. That seemed inefficient and possibly a bug, so I dived into Smart Client's code to figure out the cause. Here's what I found out (looked at both Smart Client 8.2 and 8.3 -- code's the same):
1. In the "update" callback, DataSource.handleUpdate is called
2. Inside that method it always calls DataSource.updateCaches
3. Inside that method, towards the bottom is this code:
It appears that every time after an "update" operation is performed, the cache is invalidated and thus subsequent updates have to do a "fetch" operation first before they can issue the "update".
Why is that? Is that by design? If so, why?
Thanks!
1. In the "update" callback, DataSource.handleUpdate is called
2. Inside that method it always calls DataSource.updateCaches
3. Inside that method, towards the bottom is this code:
Code:
// if we're caching all data and the cache is full, invalidate it to force a refresh if (this.cacheAllData && this.hasAllData()) { this.invalidateCache(); }
Why is that? Is that by design? If so, why?
Thanks!
Comment