Dynamic View Services > Implementing a Dynamic View Server and its Components > Buffered Dynamic Views > Using Buffered Dynamic Views
 
Using Buffered Dynamic Views
From the moment you set a dynamic view to buffer mode, all subsequent updates will be stored on the server side until buffer mode is canceled. Updates are:
*creation or deletion of representation objects;
*modification of representation attributes;
*call to a component callback from the server.
Use the function IlsMvView::setBufferMode to set the view to buffer mode and use the function IlsMvView::resetBufferMode to cancel buffer mode. These functions are also available in the API of the class IlsRepresentation.
By default, all updates are stored in an incremental way. This fact means that the update structure is maintained as small as possible:
*If an existing representation attribute is updated, only the last update is kept.
*If a representation object is notified in deletion state, all the updates that were buffered so far for this representation object are discarded (including creation update if applicable).
This feature prevents the buffered update structure to grow excessively, even if the view is kept in buffer mode during a long period. However, you should be aware that incremental mode consumes more CPU resources than non-incremental mode. In non-incremental buffering mode, all updates are kept and sent to the component when buffer mode is canceled or when the function IlsMvView::synchronize is called. As a consequence, memory grows each time an update is created.
Note that server-to-component callbacks are not stored incrementally and, therefore, make the buffered update structure grow.
You can get the size of the pending updates by calling the function IlsMvView::getBufferSize. You can also flush pending updates while staying in buffer mode by calling the function IlsMvView::synchronize.
Notes:  
1. In incremental mode, some intermediary states of the component part may be lost. For instance, if a representation object is supposed to be created, then deleted later by a subsequent notification while buffer mode is turned on, the component will never be aware of this creation/deletion.
2. When the view is being closed, all pending updates are discarded and such deletion is notified to the component if required.
3. Buffer mode for dynamic views is not related to the notion of update buffer size, which sets the maximum number of updates to be generated by a view before this view is sent in non-buffer mode. (See the “Buffer Size” section of the IlsMvView class description). No maximum number of buffered updates can be set.
A component can still interact with the representation of a buffered view using the functions onUpdate, execCallback, etc. but it will be notified only when buffer mode is canceled or when the function IlsMvView::synchronize is called.
Important: Rollback transactions are never buffered, and actions performed on the buffered view may be rolled back immediately without being buffered.

Version 6.3
Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.