My program downloads data from the server, as soon as it has received all the data, my program processes the data (checks, for example, if this data is still on the server) and saves it in my database.
Now I was wondering what if my Internet connection suddenly disconnects, what happens to the data that I just received. So I did a test. When I break the Internet connection, my program stops receiving data and goes to my method for checking data.
Now this is wrong, because it will install some data already in my database, that it is no longer on the server, when it really is.
Access to the server is through the API (web services).
So my question is a good way to handle this situation?
source
share