locked
SQL Express Client Sync Question: Detecting Online Vs Offline Status RRS feed

  • Question

  •  

    I have a tactical question regarding the SQL Express Client Sync Sample.  In this sample, each client seems to be offline most of the time but then syncs at the click of a button.  I do not understand what the mechanism would be if a client was online most of the time but offline the rest?  How could the online/offline status be detected and automatically synchronized when connected (as opposed to pushing a button)?
    • Moved by Max Wang_1983 Friday, April 22, 2011 5:09 PM forum consolidation (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Sunday, September 14, 2008 10:16 PM

Answers

  • A timer can definitely help detecting the connection to the Server database.  Therefore once the connection can be made, the sync App can implicitly do a synchronize between the server and the client to refersh the data on the screen.

    However there is still a possibility that 2 or more users sync almost at the same time so that they see the same data on his/her tablet PC.  If this happens, are they going to make the same action (pick up or drop off) on the same item?

     

    Thanks.

     

    Tuesday, September 16, 2008 5:18 AM
    Answerer

All replies

  • When Sync Button is clicked, the sync application is making connection to both Express servers.  If any connection can not be made, then synchronization won't happen.

     

    Thanks.

    Monday, September 15, 2008 2:28 AM
    Answerer
  • Also if you sync app can have access to the SQL connection object, then the connection state can be found from  its .State property as Closed or Open.

     

    Thanks.

    Monday, September 15, 2008 2:55 AM
    Answerer
  • Yes, thanks, that is a good point that I can just check the state of the connection to see if online or offline but I do not understand how I manage to keep the data on the screen to be refreshed and as up-to-date as possible.  Specifically, will I need to create a timer or is there someway this is done automatically or do I need to involve a service or process, etc? 

     

    It is possible that I am making this too complicated.  I will have several users who will be using tablet pc's to pick-up and drop-off items according to the data on their pc.  Sometimes these users will briefly get out of range and will go offline so that when they are back online their data needs to be refreshed as soon as possible so that multiple users do not go to pick up the same package.  Is there functionality already available for this type of scenario or will I need to create logic to recognize some sort of trigger when the connection is online vs. offline?

     

    Thanks,

    cj

     

     

    Monday, September 15, 2008 4:20 PM
  • A timer can definitely help detecting the connection to the Server database.  Therefore once the connection can be made, the sync App can implicitly do a synchronize between the server and the client to refersh the data on the screen.

    However there is still a possibility that 2 or more users sync almost at the same time so that they see the same data on his/her tablet PC.  If this happens, are they going to make the same action (pick up or drop off) on the same item?

     

    Thanks.

     

    Tuesday, September 16, 2008 5:18 AM
    Answerer