Results 1 to 8 of 8

Hybrid View

  1. #1
    Member
    Join Date
    May 2010
    Location
    Belgaum
    Posts
    9

    Unexpected snapshot event for DISTINCT item

    What should be the snapshot pattern in "DISTINCT" Mode ?????

  2. #2
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,091
    In DISTINCT mode, the rule is the general one, that is:
    Code:
    if isSnapshotAvailable(item) == true
       SNAP* [EOS] UPD*
    else
       UPD*
    In this case, sending the EndOfSnapshot message, though optional, is recommended, because the snapshot is sent to the client only when it has been collected entirely. If the EndOfSnapshot were not sent, the dispatching would occur after the reception of the first real-time event.

    Note that a limit on the shapshot length has to be set by the Metadata Adapter, through getDistinctSnapshotLength.
    The Data Adapter can provide a sequence of snapshot events of any length, but the first part of the sequence may be skipped, if needed to obey the length constraint.
    If the snapshot length is shorter or empty, it will be sent unchanged; however, the snapshot that the Server keeps internally (by integrating the subsequent real-time events) will grow in size until the length limit is reached.

    Other considerations are the same as for the above MERGE case.

  3. #3
    Member
    Join Date
    May 2010
    Location
    Belgaum
    Posts
    9

    Snapshot

    Thanks for reply..

    Can i set the custom snapshot (set of data as snapshot) from DataAdapter ??

  4. #4
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    Hi,

    you always send the initial snapshot events from the data adapter through the update/smartUpdate methods of the ItemEventListener you receive with each subscribe call on your DataProvider, setting the isSnapshot boolean to true.
    Did you mean something different?

  5. #5
    Member
    Join Date
    May 2010
    Location
    Belgaum
    Posts
    9
    Hi Mone,
    ya we can set the initial snapshot(static data form DB) for each subscribe call...
    But as per my understanding if same item is subscribed by more than one client at a time, the subscribe method in DataAdapter will be called only once(for first client) by lightstreamer kernel, subsequent client request will be handled by lightstreamer kernel itself, call will not go to subscribe method of Data adpter.In this case subsequent clients will not receive snapshot data. so how to pass the initial snapshot(static data from db)to the subsequent clients.

    and every client should be able to see same set of data initially..

  6. #6
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    as you said, from the second client subscribing to a certain item on, the initial snapshot will be handled by the kernel, so you don't have to prepare the initial snapshot for such clients.
    The server will keep a snapshot that will be getDistinctSnapshotLength long and will give it to any new client subscribing to such item.
    Each time a new real-time update is published for the item, the server will update the snapshot, removing (if necessary) the oldest update and adding the new one.

    So, you don't need to send by yourself the initial snapshot to all the clients.

 

 

Similar Threads

  1. Replies: 3
    Last Post: February 18th, 2010, 11:14 PM
  2. Replies: 1
    Last Post: September 18th, 2009, 09:13 AM
  3. Replies: 1
    Last Post: August 20th, 2009, 08:47 AM
  4. "item already contains key" message
    By ddhanis in forum Adapter SDKs
    Replies: 1
    Last Post: December 6th, 2007, 08:50 AM
  5. Unexpected snapshot event for MERGE
    By churrusco in forum General
    Replies: 2
    Last Post: May 4th, 2007, 03:19 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 06:14 AM.