I have a table called TOKEN. TOKEN just contains 1 row with specific informations about an external web service. On the (possible multiple) client side I want to update the row in TOKEN (1x per week). This happens by calling another web services etc. In that time nobody should be able to read and write to table TOKEN. Eg.
- Lock
TOKENso no one can read and write - Generate new informations by calling a web service (could go up to a few seconds) - client side!
- update the row in
TOKEN - Unlock the table again and let the other read and write (although write would not be needed for the next week anymore).
How could I achieve such a behaviour? If 2 users try to execute the new info. generation at the same time (while the other one is already and still executing point 2.), corrupted data could be the result. Any ideas?