Refresh ODATA every 20seconds - best practices. RRS feed

  • Question

  • Hi, I will need some help on how to easily and correctly do the following.

    I am implementing an order-management system (orders must be fulfilled as soon as areadded to the mssql database)

    For that reason I have 2 Lightswitch applications. The first one is published as a "webservice", just to expose nop-commerces Mssql data.

    The second application connects to the first Lightswitch app via the exposed ODATA.

    I want the second application to refresh the Orders/Data every 20seconds (we can not afford to lose time to get & prepare the order).

    Is it ok to do .Refresh() every 20seconds. Can we do it more professional & correctly but still easy? 

    Friday, November 15, 2013 9:11 AM


All replies

  • I would suggest you to have a look at Signal R implementation. Here is a Lightswitch HTML + Signal R example. I haven't done it before with Lightswitch, but would defenetly consider to at least investigate it as an option.


    • Edited by nicksav Friday, November 15, 2013 12:07 PM
    • Marked as answer by Angie Xu Monday, November 25, 2013 1:49 AM
    Friday, November 15, 2013 12:06 PM
  • If your app already has a grid collection that you are refreshing, then you 'can' use a timer on the screen for whatever interval you need. That said, you have to assess whether your network/server can support the traffic of your clients concurrently. If you have a robust server, it can probably handle many concurrent connections but should be tested thoroughly. I have an app that checks every five seconds for alerts (using a db field) and it works great. Again, you will want to test before implementation. Scott
    Saturday, February 22, 2014 4:16 PM
  • SignalR 2.0 works great with LightSwitch!! The current tutorials for using SignalR in LightSwitch are a bit outdated.  I recommending setting up the hub and startup classes as shown here, then following the various LS SignalR blog posts to set up the client side.  Michael Washington and Paul Van Bladel have good posts about this on their respective sites as well.  Once you get it working the first time you realize how extremely easy it is to use and how powerful.  I highly recommend this approach.
    Saturday, February 22, 2014 7:50 PM