LS_Developer
I get confused on setting snapshot length. Where should it be defined, client or server side? Can you provide some examples?
Thanks
Giuseppe Corti
Some assumptions:
the snapshot size setting concerns only the DISTINCT subscription mode while for MERGE and COMMAND its size is inherent in the nature of the items data;
the snapshot size in DISTINCT subscription mode is an application level concept.
Client can ask a snapshot of specific length in accordance with its needs.
In server side both DataAdapter and MetaDataAdapter are involved.
MetaDataAdapter must return the maximum snapshot lenght in reply to getDistinctSnapshotLength(item) call by the server. This only to prevent the server processing is too long.
DataAdapter should collaborate by sending enough data for the initial snapshot in accordance to MetaDataProvider setting.
An example:
a client that display the latest news in a grid with 10 rows.
When client subscribe itemNews it asks a snapshot of lenght 10 in order to fill the grid with the last 10 news.
If getDistinctSnapshotLength(itemNews) return 10 or greater the server supplies the client with the last 10 news; but if getDistinctSnapshotLength(itemNews) return 5 the client will receive the last 5 news only.
Hope this help.
Giuseppe
LS_Developer
What if the same data adapter set need to support various client applications and each client has different snapshot lenght requirement? For example, application A requires item X to have snapshot length to be 10 but application B requires item X to have snapshot length to be 30. How it should be setup in order to satisfy the above scenario?
Thanks
Giuseppe Corti
MetDataAdapter getDistinctSnapshotLength function must return the maximum allowed length for a Snapshot of an Item that has been requested with publishing Mode DISTINCT.
So since getDistinctSnapshotLength is specific for single Item the MetaDataAdapter must take into account the expected needs of all clients.
In the above scenario if MetDataAdapter getDistinctSnapshotLength function for item X return 50: application A will receive snapshot with length 10 and application B snapshot with length 30.
But if MetDataAdapter getDistinctSnapshotLength function for item X return 25: application A will receive snapshot with length 10 and application B snapshot with length 25.
The getDistinctSnapshotLength implementation must be a trade off between the need to satisfy all customer requests and the foresight to avoid stressful situations for the server.