开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜