georgeeapen
Hi All,
Could anyone please provide some suggestions on how i can do an initial load from a database and after that each item should be updated from another data source. When the client connects for the first time the first data load should be from the database and after that each item should receive updates from the live streaming of the stock market.Thanks in advance :Smile_Ab:
Regards,
George Eapen
Dario Crivelli
Both operations should be performed by your Data Adapter.
Upon a "subscribe" call, both the lookup on the database and the request to the runtime data source should be initiated. Note that if you don't synchronize the two operations properly, you could miss some real-time event newer than the database value or receive some real-time event that is older than the database value.
Then you should return from "subscribe" and wait for the data, to be forwarded to Lightstreamer Server in an asynchronous way.
You should take care of forwarding the result from the database first, with the "isSnapshot" flag set as true, then all the real-time updates, with the "isSnapshot" flag set as false. Any real-time update that happened to come before the initial database result should be delayed.
Note that the same operations might be needed after any further "unsubscribe" and "subscribe" calls for the same item.
As Lightstreamer, we can't suggest you "how" you can do that.