lundi 14 septembre 2015

upgrading an android sqlite database while it is upgrading

I have a module that is accessing a sqlite database to write all the data downloaded from a webservice. Because it takes a lot time inserting the rows, it is launched by a independent thread at the background so, the UI thread is secured. The problem is, this process, can be called while the database is still upgrading causing duplicated rows (because the data from the webservice is always the same plus new content)

I need something that can ask SQLite if its upgrading and wait until it ends to call the new upgrading. Any ideas aplying SOLID principles?

Aucun commentaire:

Enregistrer un commentaire