This project has moved. For the latest updates, please go here.

What happens when the service is down

Dec 5, 2011 at 10:59 AM

I m trying to figure how to solve a issue im facing.

I implemented AgFX and is all good, i even have a customloadrequest for getting data for prepolutation the cache with info i send with the app.

Also when i have internet i go to a service and get the new data using WebLoadRequest.. but i m facing sometimes a problem.. imagine my service in the cloud is down... and returns a not found.. the webloadrequest will fail and the app crashes.. 

Should it be built in a grafecull fallback.. for timeouts/ and not founds ?! or should i check if my service is up before returning the webloadrequest..

Thanks 

Coordinator
Dec 5, 2011 at 7:12 PM

Hi -

These are always a tricky thing to deal with.

Here are the options I can think of:

  1. Implement a Retry/Timeout LoadRequest that catches an exception, backs off, then tries again some number of times for certain error codes.
  2. Handle DataManager.UnhandledError to process these exceptions and prevent the app from crashing (you should always do this...)

I think a mix of 1/2 is best, depending on the types of failures.  With mobile devices, these intermittant fails could happen at any point between a device and the service, so some retry is probably a good idea.  But really it depends on the type of the error.  If the service is completely down, then you'll need to have code that puts the app into a state were it doesn't do anything until some code verifies the service is responding.

Hope that helps,


Shawn

Dec 6, 2011 at 12:05 PM

yeah shawn  sure it helped.

I implemented the retry feature, basically the server shouldn't be down.. but sometimes we are deploying new versions and it goes down for some seconds and the service was failing because of that.

it's fixed now. 

thanks