Results 1 to 8 of 8
  1. #1
    Member
    Join Date
    May 2007
    Location
    London
    Posts
    1

    Question about - "Unexpected snapshot event for MERGE item"

    Hi all,

    I have a question about a warning message I'm getting in Lightstreamer - "Unexpected snapshot event for MERGE item"

    I am currently trying to use LightStreamer to pump out data from a GigaSpace, the object is fairly large and it is being keyed on a unique ID.

    The objects are in the Gigaspace and when my client gets a Lightstreamer connection they are retrieved, however the warning message is then displayed and nothing is reported in the client - i.e. nothing is received via the "onUpdate" method (the other callback methods are empty.

    i have tried in both RAW and MERGE modes, and there appears to be no difference.

    I'd be grateful if anyone knows what the issue could be?

    Thanks

    Richard

  2. #2
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,089
    Hi Richard

    The Server expects that the Data Adapter sends the update messages for each item by following this general rule:

    Code:
    if isSnapshotAvailable(item) == true
       SNAP* [EOS] UPD*
    else
       UPD*
    where:
    SNAP represents an update call with the isSnapshot flag set to true
    EOS represents an endOfSnapshot call
    UPD represents an update call with the isSnapshot flag set to false

    However, more stringent rules apply based on the item mode (remember that the mode pertaining to each item is defined by the Metadata Adapter through the modeMayBeAllowed method; at most one out of the MERGE, DISTINCT and COMMAND modes can be associated; furthermore, in each of these 4 cases, the RAW mode can be associated, leading to 8 possible cases, one of which associates no modes to the item and is not meaningful).

    In MERGE mode, the rule becomes:
    Code:
    if isSnapshotAvailable(item) == true
       [SNAP] [EOS] UPD*
    else
       UPD*
    where a missing snapshot is replaced by an empty snapshot.
    However, redundant SNAP events, after generating the reported log line, are just converted into UPD events; so, they are NOT DISCARDED.

    In RAW mode, on the other hand, isSnapshotAvailable is ignored and the rule is always:
    Code:
       UPD*
    And all SNAP and EOS events are IGNORED.

    Note that if the same item is enabled in both MERGE and RAW modes, then each event follows two distinct routes, where the two rules are applied independently.

    Also, note that this update interpretation rule is restarted after each different subscription of the same item. The Server ensures that, for a single item, the subscribe and unsubscribe calls to the Data Adapter are issued in sequence and follow the pattern:
    Code:
    (subscribe unsubscribe)*
    After each subscribe call, the interpretation rule is restarted until unsubscribe is issued. Then all events are discarded until subscribe is issued again. If the Data Adapter enqueues some updates and sends them to the Server asynchronously, then some problems may arise in case of a fast unsubscribe/subscribe sequence. Using smartUpdate, however, is safe from this point of view.

    May you please check the subscribe/unsubscribe/update sequences occurring in your system?
    You can have the Server log these events by setting the "LightstreamerLogger.subscription" logger priority as "DEBUG" in Lightstreamer Server logging configuration file.

    Consider, however, that the reported warning may be unrelated to your problem.
    A mismatch in the field names used may be the cause as well.
    You can compare the events received from the Data Adapter and the events sent towards the client by setting the "LightstreamerLogger.pump" logger priority as "DEBUG" too.

    Dario

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

    Unexpected snapshot event for DISTINCT item

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

  4. #4
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,089
    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.

  5. #5
    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 ??

  6. #6
    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?

  7. #7
    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..

  8. #8
    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 19th, 2010, 12:14 AM
  2. Replies: 1
    Last Post: September 18th, 2009, 10:13 AM
  3. Replies: 1
    Last Post: August 20th, 2009, 09:47 AM
  4. "item already contains key" message
    By ddhanis in forum Adapter SDKs
    Replies: 1
    Last Post: December 6th, 2007, 09:50 AM
  5. Unexpected snapshot event for MERGE
    By churrusco in forum General
    Replies: 2
    Last Post: May 4th, 2007, 04: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 08:32 AM.