> How to write and read the same sqlite3 DB in memory concurrently in two > thread?
You need to use one connection (sqlite3 object) and not to use SQLITE_OPEN_NOMUTEX flag (assuming you used default SQLite compilation options) or protect access to sqlite3 object with your own mutex. Pavel On Fri, May 25, 2012 at 4:51 AM, 吴 毅 <[email protected]> wrote: > Now I am writing datas to sqlite3 DB in memory(":memory:") in a thread . > And concurrently I want to read the datas of the same DB in memory too. > but While i used the same object of sqlite3 to write and read, i had got the > error:SQLITE_MISUSE. > If i use the different objects of sqlite3 to write and read > concurrently,these objects get the different DB in memory.This is not I want > to do.I want to get datas of the same database. > Moreover, I don't plan to write and read the database in disks too.Becase I > thick it's more faster to operate in memory. > I open the database in the way of "m_sqliteDB.open(":memory:");" now. > > How to write and read the same sqlite3 DB in memory concurrently in two > thread? > > That might be? > > thank you. > _______________________________________________ > sqlite-users mailing list > [email protected] > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

