Hello rkvino,
We received your log.
The log contains a lot of activity, even if in just 3 minutes.
So, we also need some coordinates to find the cited episode in the log.
Please specify the name of the item in COMMAND mode involved in the issue, as there are many in the log.
If possible, please also specify the name of the key that was supposed to be deleted and appeared again.
What I can say at this stage is that if I do a case-insensitive search for "delete" in the log I can see it only twice.
In practice, it is the value associated to a custom field, "FeedStatus", which is received from the Data Adapter and then forwarded to the client.
By the way, I also see the values "ADD" and "UPDATE" associated to this field.
This raises the suspect that you are not leveraging the items in COMMAND mode in the correct way.
Let's call "List" the item in COMMAND mode which contains the list of stocks.
Let's suppose that you would like to delete "Stock-3".
You have to:
- create an update event (for instance a Map);
- set field "key" to "Stock-3";
- set field "command" to "delete";
- send the update event for item "List" to Lightstreamer, by invoking listener.update(or listener.smartUpdate ).
In your code, you invoke some
listener.onDeleteStatus, but this is
not a method from LS APIs, this is still your code.
So, you should ensure that your
onDeleteStatus behaves like I described above.
You can see
what our Portfolio Demo Adapter does, as a reference.
-------------
If you add a key to a COMMAND item, it is kept in the item's state.
This means that other clients subscribing to this item will receive the key as part of the initial snapshot.
This is the only "in-memory storage" that we apply.
But if you delete the key in the proper way, it will be removed from the item state and no other caching will apply.
The Item's state is also cleared when the item is unsubscribed from by all clients; in this case,
unsubscribe will also be invoked to your Data Adapter.
Upon the next client subscription,
subscribe will be invoked to your Data Adapter and the item's state will be reconstructed from scratch.
A third possibility, as already suggested, is that you invoke
clearSnapshot.
Did you try it?
The code shown seems correct, but I can't find occurrences of "clearSnapshot" in the log.
Obiously, you can use
clearSnapshot only to ensure that no key will be present in the list.