Is it possible for 2 threads to select/insert data from/to the same sqlite database?
Is it possible for 2 threads to select or insert data in same sqlite database on Android开发者_如何学运维?
If they'll try to write something simultaneously, than, I think, you'll get errors. Not to mention conflicts, if 2 thread will try to change the same data.
I think the better solutions would be 1 manager that writes to the database, and queue of actions, that must be executed by this manager.
You can have some kind of listener for this queue, that will notify the manager, that new actions are awaiting for processing, so you won't need to implement a timer, or something for checking the queue continuously.
精彩评论