Results 1 to 9 of 9

Thread: Priority task

Hybrid View

  1. #1
    Senior Member
    Join Date
    Oct 2009
    Location
    cbba
    Posts
    33
    thanks for your reply Mone,


    a user subscribes to LS (Lightstreamer). then my Javaadapter has an infinite loop querying the database for updates on multiple tables. but this is not optimal, it query to the database unnecessarily, so i need i way to perform this query to the database only if some value in the database was changed.
    this depends on your DB, if it has a way to notify you that something has changed than you may just wait for such notifications and only then query it.
    Otherwise keep in mind that an infinite strict loop is always a bad idea (even if, having a blocking call to query the DB you'll not have a proper strict loop unless the network is down and the connection to the db fails immediately)
    i agree with you, that is why i seek another solution to an infinite loop.

    i not quite understand your reply, how can DB tell to my JavaAdapter that some tables has new data?? (that is the question). is That what you propose??

    thanks again for your answer.
    Naitsir

  2. #2
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    well, I'm not an expert on DBs, so that I can't point you to an actual implementation, btw I imagine that as a DB (or a cluster of DBs) knows whenever something changed on its tables, than maybe there are some implementations able to notify a listener every time this happens. I'm just guessing, you should do some research on this.

  3. #3
    Senior Member
    Join Date
    Oct 2009
    Location
    cbba
    Posts
    33
    Quote Originally Posted by Mone
    well, I'm not an expert on DBs, so that I can't point you to an actual implementation, btw I imagine that as a DB (or a cluster of DBs) knows whenever something changed on its tables, than maybe there are some implementations able to notify a listener every time this happens. I'm just guessing, you should do some research on this.
    hi Mone,
    not necessarily the DB have to tell to my listener that execute a query to the DB. Could be another Java Class (runs at any time)
    eg. LS server is running with my JavaAdapter waiting subscription of Users Web Browsers.
    now, at any time, some user (not the same that web browser) execute another JavaClass, when this JavaClass save some data in DB also send a notification to my JavaAdapter (without a subscription) to say that there are new data on the DB.
    then my JavaAdapter catch the notification from the another JavaClass and execute a query to the DB, the JavaAdapter do something with the data and send a message to the Web browser.

    generally, is there any way to tell my JavaAdapter to do some task from another place(DB, javaclass, etc)??

    i hope you understand me now

    see you,
    Naitsir

  4. #4
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    ok, that's clear;

    you can use the sendMessage method on your clients to notify the metadata adapter with any custom message, then in turn the metadata can notify the data adapter to tell it to do "something".

    This communication approach is shown on our ChatDemo (btw, no DB involved). Both client and adapter source code is available in the server distribution; take a look at it and let me know if something is unclear or does not fit your needs.

  5. #5
    Senior Member
    Join Date
    Oct 2009
    Location
    cbba
    Posts
    33
    great! this sound promising, i will research about it.

    thank you very much for your help.
    sorry for the inconveniences

    Naitsir

 

 

Similar Threads

  1. Message in browser task bar
    By finodex in forum Client SDKs
    Replies: 1
    Last Post: June 6th, 2012, 10:32 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 01:56 AM.