Sqlite3 Concurrency Issue in IOS -


i using sqlite 3 in ios application. requires lots of read/write operation , many of them attempted concurrently. of these functions running in separate threads, accessing same database.

here few methods have thought of:

  1. at every database access ( read/write ) put flag database_open=yes, , if found true retry again in few seconds. can put function @ database layer itself.

  2. run database operations in same thread. however, use case such need wait http calls finish , store retreived data sqlite. method, have make these server calls synchronous. not best idea.

please suggest if thinking in wrong direction.

sqlite supports concurrent access multiple threads. configure sqlite_config_multithread mode, , separately open database each of threads.


Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

c++ - Correct method for redrawing a layered window -

java.util.scanner - How to read and add only numbers to array from a text file -