jeudi 9 avril 2015

SQLite : How to fulfill readers when database tables are deing truncated and refilled?

This is with reference to approach proposed in this question but without blocking readers.


I have a database. At some point, I am truncating all the tables and refilling them from a secondary DB. Is there some way that when I am doing all this (truncating tables and refilling them), readers are not blocked, ie. , they can continue to access previous data and as soon as copying is finished, they immediately start seeing all the new data?


I guess doing all this in begin-commit also will still acquire a lock. Though when I replicated all this through terminal, I didn't see any lock. Not sure, how will it behave in real scenario.


Aucun commentaire:

Enregistrer un commentaire