I have written a .dll that uses sqlite3. It has an insert function that performs inserts on the database.
I also have a test executable that uses the dll to perform inserts. Right now I am testing sqlite and its ability to manage multiple connections. The test program inserts in an infinite loop, the pseudo code looks like this:
while(1) {
openDb();
doInsert();
closeDb();
}
Basically I have set it up so that I run 4 versions of my test app, and each version inserts a letter (a, b, c or d) into the database.
Right now, this doesn't work because the database is just about always locked. It works fine with one or two but it doesn't if I run all 4 programs its like I create one big race condition.
I have looked at the documentation, and I have come accross things like SQLITE_OPEN_FULLMUTEX as specified here: http://www.sqlite.org/c3ref/open.html
Does sqlite3 provide a mechanism to deal with multiple exe's trying to write to he same DB at once? Or am I simply pushing sqlite too hard in my load-testing? Do I need to write my own connection pool?
Any help on this matter would be great. Thanks.