On 3/13/06, Rafal Rusin <[EMAIL PROTECTED]> wrote: > > Maybe you want to call this: > > > > " int sqlite3_busy_timeout(sqlite3*, int ms); > > > > This routine sets a busy handler that sleeps for a while when a table > > is locked. The handler will sleep multiple times until at least "ms" > > milliseconds of sleeping have been done. After "ms" milliseconds of > > sleeping, the handler returns 0 which causes sqlite3_exec() to return > > SQLITE_BUSY. > > > > Calling this routine with an argument less than or equal to zero turns > > off all busy handlers. " > > > > Like I said, I tried to use it without success. There was a deadlock > when I tried to use it with python pysqlite2 with 10 threads > simultanously accessing DB.
If your code has a deadlock that waiting won't fix have one of the threads rollback it's transaction and retry it from the beginning. Alternatively use "begin immediate" around the code that's deadlocking. That will serialize access to the resources.