On 10/4/2017 10:17 PM, Hegde, Deepakakumar (D.) wrote:
There is a problem we are facing with the multiple DB process write operation.
Following the procedure:
1) Open the Database in the two process as:
sqlite3_open_v2 (pcDbName, &psRaceSqlite->sSqliteInfo.pSqlHandle,
(SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_FULLMUTEX), NULL);
2) Both the link are added the busy handler and busy handler function is
retries for 10000 times with 10ms second of delay.
sqlite3_busy_handler(psRaceSqlite->sSqliteInfo.pSqlHandle,
dbm_sqlite_busy_handler,psRaceSqlite);
3) In one thread there is a continuous record insertion with begin and commit
operation. This begin and commit will be done with for every 200 record
insertion. time for a single begin to the commit is about 1 second.
Use BEGIN IMMEDIATE or BEGIN EXCLUSIVE here. For rationale, see
http://sqlite.org/c3ref/busy_handler.html
the paragraph that mentions "deadlock". Also
http://sqlite.org/lang_transaction.html and http://sqlite.org/lockingv3.html
--
Igor Tandetnik
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users