How to control if my data expired before update?
The data expiration control is one of the main problem with stateless and multi access applications. The web service should check if data on the back end was changed meanwhile. How to do it? There are many ways to check if data was changed. The most trivial one seems to be lock record while reading. Then unlock if update operation is performed. But this is against stateless rule. You never know if the update operation will come and will be operated by the same job. It may happen that update operation will never be sent from client. What to do then with locked records? In aperio we introduced mchanism which helps You to calculate record state hash code. Based on entire record from database you can calculate hash code. There is possbilitity to send to the client hash code of record together with data while reading. Then the update procedure must send saved hash code back to the manager program. Manager program once again calculates current hash code of record and compare it to this one which was received from client. If there are no changes then update is allowed. If hash codes are different then error message is send back to the client.
There is procedure which calculates hash code based on any data. You need to provide addres of data and size of data in bytes.
Here is example how the “get” method/program may be created:
Here is example how the “update” method/program may be created:

Getting data from file to client
