Android sqlite concurrency without exceptions

后端 未结 2 1487
你的背包
你的背包 2020-12-11 02:47

Sqlite on android lets you access the database from multiple procs for reads, but if you\'re currently writing from one process, reads and writes from other procs will throw

2条回答
  •  Happy的楠姐
    2020-12-11 03:26

    Or you can use another database that does support it, like H2. I know it may sound like a strange idea. But according to my initial test it works well (on the emulator as well as on the device), and is actually not slower. Except for opening and closing a database, which is currently quite slow, about 1 second, but that has other reasons, and hopefully will get fixed in the next version.

提交回复
热议问题