Results 1 to 6 of 6
  1. #1
    Senior Member
    Join Date
    Oct 2009
    Location
    cbba
    Posts
    33

    Refresh browser problems

    hi again,

    sorry for the inconveniences

    i have another inexplicable problem. this is the scenario:
    i create a master push page with a nonvisualtable (something like the examples show, nothing special).
    then, i create an java adapter. in the constructor i create the connection to the DB, i use this connection in the infinite loop ( while(go){ ... } ) to check the status of some tables, if the state is true send a message to the client and change the state to false. i put this into the loop Thread.sleep(5000 + rand.nextInt(5000))

    then i restart the LS server and load the master push page in the browser. i change the state of the table to true to see the result and everything works fine.

    the problem occurs when i refresh the browser, i try to simulate the operation (changing the state of the table to true) but i don't get any result

    please, can you helpme?? why this happends??

    this is a summary of my log

    Code:
    #when i start LS server
    [TRACE] .<init>(64) => CLASS-Load global variables from file
    [TRACE] .<init>(111) => CLASS-Variables loaded
    [TRACE] .openConn(131) => CLASS-creating the conecction to the DB
    [TRACE] .openConn(136) => CLASS-BD connection created
    
    #when a new user try to subscribe
    [TRACE] .validateUser(231) => CLASS-Validate user
    [TRACE] .subscribe(313) => CLASS-Begin the subscription: itemName --> ITEM
    [TRACE] $GreetingsThread.<init>(348) => CLASS-Constructor de clase Thread
    [TRACE] $GreetingsThread.run(355) => CLASS-Run the Thread
    [TRACE] $GreetingsThread.run(369) => CLASS-Begin the infinite loop: ITEM
    
    #when i refresh the browser
    [TRACE] .validateUser(231) => CLASS-Validate user
    [TRACE] .subscribe(313) => CLASS-Begin the subscription: itemName --> ITEM2
    [TRACE] $GreetingsThread.<init>(348) => CLASS-Constructor de clase Thread
    [TRACE] $GreetingsThread.run(355) => CLASS-Run the Thread
    [TRACE] $GreetingsThread.run(369) => CLASS-Begin the infinite loop: ITEM2
    [TRACE] .unsubscribe(333) => CLASS-End the subscription: ITEM
    [TRACE] $GreetingsThread.run(419) => CLASS-End the infinite loop: ITEM
    on this log i see that the user create a new item to subscribe and then unsubscribe the previous item.

    do you have any idea??

    regards.

  2. #2
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    As far as I can understand from your log the second client subscribes to a different item, could this be the root of your problems?

    on this log i see that the user create a new item to subscribe and then unsubscribe the previous item.
    the unsubscription is not sent by the browser; the server after a timeout, if there are not clients subscribed to a certain item, unsubscribes the item from the adapter

  3. #3
    Senior Member
    Join Date
    Oct 2009
    Location
    cbba
    Posts
    33
    Hi Mone,
    thanks for your help, you were right
    i change a little the code to create and obtain the same item name for the same user, now all works fine

    regards.

  4. #4
    Senior Member
    Join Date
    Oct 2009
    Location
    cbba
    Posts
    33
    i have another doubt,
    if there are not clients subscribed to an item, where can i define the subscription lifetime for that item??
    after that time, perform unsubscribe the item.

    see you.

  5. #5
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,090
    You cannot control the subscription lifetime directly.
    As soon as the last client issues removeTable, an unsubscribe call is received by the Data Adapter.

    If, however, a client just closes its connection (that is, it closes or refreshes the page) while a subscription is active,
    then the session is kept alive for a few seconds and the subscription is also kept for this time.
    This time can be configured through the <session_timeout_millis> configuration element.

  6. #6
    Senior Member
    Join Date
    Oct 2009
    Location
    cbba
    Posts
    33
    thanks for your help

 

 

Similar Threads

  1. Don't send message when refresh the browser
    By naitsir in forum Client SDKs
    Replies: 7
    Last Post: October 2nd, 2012, 11:36 AM
  2. on clicking refresh button on WIn IE
    By Pradeep Chahal in forum Client SDKs
    Replies: 4
    Last Post: November 17th, 2009, 07:17 AM
  3. Web client automatically refresh????
    By lethanhclub in forum Client SDKs
    Replies: 5
    Last Post: September 11th, 2009, 10:01 AM
  4. Problems with Opera browser
    By webfg in forum Client SDKs
    Replies: 2
    Last Post: May 11th, 2009, 05:39 PM
  5. Problems with Opera browser
    By webfg in forum General
    Replies: 0
    Last Post: May 11th, 2009, 12:07 PM

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 03:40 PM.