0

I am creating simple SQLite database where multiple processes write to tables simultaneously. Here each process has its own table to be updated with INSERT statements.

Here is my sample code:

CSQlite:: OpenDB()
{
    SQlite3_open("SSCOB.db",&db); //database is created/opened here
}
CSqlite::QueryDB()
{
    db.sqlite3_exec(db,<insert query>,callback,(void*)data,&zErrMsg);
}

This class is accessed from multiple processes.

After processes got executed, when I verify the data, I found some of the rows(to be inserted are) missing from tables.

I am new to SQLite and may be missing some important connection to the DB. Please do help me to figure out the rootcause.

Komal12
  • 3,340
  • 4
  • 16
  • 25
  • What OS, (network) file system, and virtual machine are you using? See http://www.sqlite.org/howtocorrupt.html. – CL. Apr 20 '17 at 12:35
  • OS is Windows xp, file system is NTFS. I am not using any virtual machine. I am creating SQlite database file on my local drive itself. From the link http://www.sqlite.org/howtocorrupt.html, I feel my situation is :2. File locking problems- "SQLite uses file locks on the database file, and on the write-ahead log or WAL file, to coordinate access between concurrent processes.". But I am not aware how to resolve it. Could you please help me on how to implement this file locking in my c++ code – Lavanya bhuma Apr 21 '17 at 08:12

0 Answers0