>> At the end of the loop, instead of having 4000 rows I have 3976 rows
>> (it's random, sometimes I have 3972 or 3974).
>> sqlite3_exec doesn't returns any error during the INSERT statement,
>> but I have some errors during the BEGIN IMMEDIATE, errors are all:
>> SQL logic error or missing database (printed with sqlite3_errmsg).

> Your use of sqlite3_errmsg is itself very likely a race. Between the 
> time you detect an error and the time you retrieve error message, the 
> other thread could have run some statements that modify the error 
> message. Moreover, between the time you call sqlite3_errmsg and the
time 
> you actually print the string pointed to by the char* pointer the 
> function returns, the string may be modified or even deallocated.

> Igor Tandetnik 

Is it safe to use sqlite3_errmsg() when each thread is using its own
connection handle to access the database and get the error messages for
that connection?


_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to