On 3/13/06, Rafal Rusin <[EMAIL PROTECTED]> wrote: > Hello, > > I'm having problems with famous multithread bug > "Database is locked". > I tried to work around that with sqlite3_busy_timeout > or busy_handler, but with no success. I had deadlocks. > I was using version 3.3.4 on Debian Linux. > Could You give me some links to discussion on that > topic? > Maybe there are some future plans to change > implementation so it won't return SQLITE_BUSY > error, but wait? It's quite annoying and should be replaced > with some kind of quality multithread solution. > Maybe with some semaphores or fifos on linux > and similiar things on windows.
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. "