Answer the question
In order to leave comments, you need to log in
How to ensure the autonomy of the program from the server?
Given:
Answer the question
In order to leave comments, you need to log in
Offline save a draft contract without a number and date. Register them when synchronizing with the server.
generate a unique contract number that includes something unique for each program instance.
The contract number is not a fixed number and can contain everything you need (it is advisable to use regular characters, of course).
If you want contract numbers in order, forbid offline.
You can first make a draft contract, without a number, but then be sure to register on the server and get a number.
For everything else that is added, it receives an ID greater than 10 million (for example), and during synchronization, all records that have ID> 10 million are sent and new IDs are received in response. Old ones are replaced by new ones.
If they want to take into account such cases, they usually use queues, ready-made or self-written. Before giving to the server, the document is queued, there is a connection - the queue is moving, no - the queue is growing. I'm not aware of the subject area, but if the numbering order is important, then maybe it's worth transferring the numbering to the server? The server received and numbered itself based on some metadata that will come with the document.
If, according to the conditions of the task, the server is sometimes offline, and the client is always online, then you just need to transfer the number generation to a service with a good SLA.
If the client is offline and there is no mob. Internet, but there is a mob. communication, i.e. not quite in the taiga, then it’s possible in an oak way: make an SMS service, send an SMS to a number, the service sends a generated number in response, drive it in with pens.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question