-
July 12th, 2010, 04:23 PM
#1
Some more information re the two different errors...
The sequence of events seems to be:
- Data\Metadata adapter service restarts
- RobustNetworkedMetadataProvider fails, recovers, and requests a snapshot of data from adapter
- My adapter takes ca.10sec to start up as it loads a lot of historic data, so in the meantime LS Server is trying to request data for items that my adapter knows nothing about yet, and throws "Generic Exception" errors
Then, any time after this happens, if a client subscribes to items via the webpage, the "Unexpected updates for item..." is logged and a full snapshot is not sent (in the LS log file I can see a new session being attached and controlled), but updates do come through.
If I then refresh the page a full snapshot is sent as expected.
-
July 13th, 2010, 09:05 AM
#2
If your Remote Data Adapter takes some time to initialize and, during this time, it is unresponsive to subscription requests,
then it is probably better making it unavailable for that time.
You can either postpone the opening of the sockets or block the processing of the init method until the initialization has finished.
Note that the response to the Subscribe call is supposed to be fast and a timeout of exactly 10 seconds is applied by the Proxy Adapter. If the timeout expires, the Proxy discards the request and subsequent related updates are also discarded.
This can explain the "Unexpected update" errors.
The "Object reference not set" errors, on the other hand, seem to be internal to your Data Adapter implementation.
So, alternatively, you could enlarge the timeout (configured in adapters.xml) or, preferably, have Subscribe answer immediately, regardless of the data availability. In fact, if you don't send the snapshot immediately after returning from Subscribe, this is not a problem from Lightstreamer point of view, provided that the client can accept that.
-
July 13th, 2010, 02:37 PM
#3
I have found the issue.
You are correct Dario, in that the "Object reference not set" errors were internal to my Data Adapter implementation, and this was the root cause of everything else.
In my Subscribe method, I am calling a custom class's public method to do the sending of the updates. I am instantiating this class on a separate thread in my Init method.
However, in the Subscribe method this class was sometimes null, because in the ca.18ms it took to start the thread and initialise the class, the subscribe method had already been called.
Thanks for your help with this, these forums are excellent.
Colm
Similar Threads
-
By ablock in forum Client SDKs
Replies: 1
Last Post: May 2nd, 2012, 12:56 PM
-
By AidasOzelis in forum Client SDKs
Replies: 13
Last Post: June 3rd, 2010, 01:13 PM
-
By rekhender in forum Adapter SDKs
Replies: 1
Last Post: October 31st, 2008, 09:58 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
All times are GMT +1. The time now is 01:38 AM.
Bookmarks