0

I am having a task to Auto Save data after every 5 minutes which is filled in more than one forms however I dont want to save the data in the actual dataset. The main aim of auto save is as there are many fields on the form and the user has typed in details spending his valuable time and during this time if the server goes down then the application would crash thereby loosing the data typed in.

If the application has crashed then next time when the connection takes place then a message should pop up saying "Do you want to recover the lost changes?" once clicked yes then the auto saved form should be shown.

Just a side note my application is working on datasnap model.

Any suggetions how to go about this really appreciated.

mano
  • 308
  • 3
  • 19
  • 1
    Well sounds like customer is always right (i think this is pointless). But i would write the data to local textfile if im afraid of connection crashing, kind of like logging the code – Henrikki Feb 10 '17 at 07:05
  • @Henrikki "Write the data to local textfile" suppose I have 100 components on my form where there are richedit, memo and combobox then how to go about, as i have to get back once if user want to recover if connection is lost , I knew I have to log however looking for optimized way to handle this situation. – mano Feb 10 '17 at 07:09
  • Check this question at SO http://stackoverflow.com/q/3163586/6371073 – Henrikki Feb 10 '17 at 07:49
  • @Henrikki Thanks would check this one. – mano Feb 10 '17 at 08:01

1 Answers1

0

Not sure if this is an option, but perhaps you could deploy the application with a lightweight database (such as SQLite or NexusDB)? If you have a lot of forms with a lot of fields/data, this would make a drafts based solution quite easy to implement.

The idea would be to have a "drafts" table in your local database which is a flat table that will contain and hold all of the data that you want to persist until the transactions are committed to the server database.

Save the data in the forms to this local drafts table (as the user enters them in or on a periodic basis). Once the transactions in the forms are committed to the server database, you can delete the draft record from the local drafts table.

If the app crashes and the user signs back on, you will be able to check the local drafts table and pull the data that you need back into the screen fairly quickly and easily.

Hope this helps.

Rohit
  • 909
  • 1
  • 9
  • 20