Results 1 to 10 of 14

Hybrid View

  1. #1
    Member
    Join Date
    Jul 2009
    Location
    London
    Posts
    14

    Question Subscribing to the Table

    To subscribe to the table "Table 1" we are calling LSClient.SubscribeTable() passing ExtendedTableInfo. Constructor of ExtendedTableInfo does not accept table name, it accepts an array of item names. If we pass an array with one item and put a table name into it we can get all the items in the table. Is this the right thing to do (the constructor of ExtendedTableInfo is accepting a list of table names) or is the picture in page 5 of General Concepts.pdf is incorrect? In any case why does ExtendedTableInfo constructor accept an array of items?

  2. #2
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    988
    With reference to the picture in General Concepts.pdf, a data table is characterized by a list of Item names or, alternatively, by a "Group" name.
    The two alternatives are reflected by the overloads of LSClient.SubscribeTable():
    • If you supply a SimpleTableInfo instance, you are describing the table through a Group name; the Metadata Adapter will expand the name into a list of items in getItems.
    • If you supply an ExtendedTableInfo instance, you are describing the table through a list of Item names; the Metadata Adapter will still receive a call to getItems and in this case it will receive the space-separated join of the Item names and it will be supposed to extract the Item names from the bundle, as the LiteralBasedProvider does.

    Note that the name of the data table ("Table1" in the picture) is not used by the Server, hence LSClient.SubscribeTable() does not require you to specify one.

    Your claim that
    If we pass an array with one item and put a table name into it we can get all the items in the table
    does not fit into the above description and should be clarified.

  3. #3
    Member
    Join Date
    Jul 2009
    Location
    London
    Posts
    14
    Thank you for the prompt response.

    In our case we need to subscribe to the whole table. We don't know the list of items at the time of subscription. We are subsribing in a COMMAND mode and are expecting to receive a snapshot i.e. a list of items.
    Should we use the SimpleTableInfo for this?
    Does a group always contain all items in a table, or can it be a subset?

    Presumably, in the method OnUpdate from an IHandyTableListener the itemName parameter is a unique name for an item within the table (as in "Item 1" in the diagramme on page 5). How is this different from the "key" field used in command mode?

    Currently we are passing what we thought was the table name into the ExtendedTableInfo as an item in an array of one element (we are specifying the fields in the Update method of an IItemEventListener on the server side within the itemEvent dictionary and are passing what we thought was the table name as the itemName in this method call). This is in command mode using distinct keys in the key field. This seems to work as we thought; we recieve a list of items (single items in quick succession) on snapshot and updates for seperate items as they are updated.

    Many thanks.

  4. #4
    Member
    Join Date
    Jul 2009
    Location
    London
    Posts
    14
    Having investigated our current code it looks like our table contains a single item. This is replaced each time with any new update. This results in the correct data appearing on the front end, but is obviously suspect (and we will need to reimplement). Does this sound like what could be happening?

    1. Does MetadaAdapter have to know the list of items for the table and send them to the LS kernel when a client is subscribing using SimpleTableInfo?

    2.When a new item is created should the app server notify both DataAdapter (to actually send data with the add command) and MetadataAdapter (to relate it to the relevant groups when another subscription request is received)? When the DataAtapter is sending data and there are no subscriptions the warning message is being written to the log file.

    3. Are snapshots requested for one item or for the whole group?

    4. How do we notify the client of new items that need to be subscribed to i.e. expand the set contained within a group so that the client can issue a subscription request for those items?

  5. #5
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    988
    If you use COMMAND mode, then your approach is now clear.
    We just need to agree on the names of the various concepts.

    We use the concepts of Group and Item list to define static tables with a fixed number of lines, each of which corresponds to an Item that is usually managed in MERGE mode.

    On the other hand, if you subscribe to an item in COMMAND mode, then the item values carry commands that say: "ADD, UPDATE or REMOVE a line based on a specified key".
    Hence, by subscribing to a single Item, the client can maintain a whole data table based on the updates received for that single item.
    So, if you use items in COMMAND mode, you will usually subscribe to a table that, from Lightstreamer point of view, only contains one Item (i.e. the Group associated to the table is made of only one item).
    When only one item is involved, it is not important whether you use a SimpleTableInfo or an ExtendedTableInfo; your Metadata Adapter will receive the item name and shoud pass it through to the kernel (note that the ExtendedTableInfo is to be preferred because it still simplifies the management of the fields).
    On the client listener, all updates are referred to the unique item involved, but, for each update, you can extract the value of the "key" field involved. Using a HandyTableListener is recommended.

    Please check whether your questions about groups are still needed in this scenario.

  6. #6
    Member
    Join Date
    Jul 2009
    Location
    London
    Posts
    14
    1. If we have a dynamic table we should subscribe as described in the initial question?

    2. If so it is not clear how the snapshot is working; will lightstreamer cache updated items and be able to send initial data to the client without calling a DataProvider? How will authorization work in this scenario?

    3. Having checked our current implementation in the debugger, our IUpdateInfo's GetOldValue() method gets the previous item's value, not the old value for the current item. Is this to be expected in command mode, or should we be receiving the old value for the current item?

 

 

Similar Threads

  1. Subscribing to multiple items
    By ablock in forum Client SDKs
    Replies: 1
    Last Post: May 2nd, 2012, 12:56 PM
  2. LS table how it works
    By betasec in forum Client SDKs
    Replies: 1
    Last Post: February 21st, 2011, 10:03 AM
  3. Problem re-subscribing
    By colmfield in forum Client SDKs
    Replies: 5
    Last Post: July 13th, 2010, 02:37 PM
  4. Update Table
    By EWANG in forum Client SDKs
    Replies: 1
    Last Post: August 19th, 2009, 10:17 AM
  5. having problem while subscribing pairs
    By rekhender in forum Adapter SDKs
    Replies: 1
    Last Post: October 31st, 2008, 09:58 AM

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:42 AM.