On 7 Jan 2014, at 2:26pm, Woody Wu <[email protected]> wrote: > What means "using _timeout()" properly? The manual says, _timeout() can > still make _step() returns SQLITE_BUSY or SQLITE_IOERR_BLOCKED if the user > provided timeout value eventually accumulated. For example, if I set > _timeout() to 3000ms, but after that time, the table I was trying to update > still locked by another process. This is normal, right?
Yes, if you do have a situation where a process can keep a database locked for 3 seconds, then it is normal for another to get SQLITE_BUSY or SQLITE_IOERR_BLOCKED even if you've set a _timeout(). So it's usual to set a far longer timeout period -- whatever time you would really want your software to try before giving up and quitting. You might set it to 30 seconds or even five minutes. Getting _BUSY should indicate that you have serious hardware problems, or that one of your applications has crashed and needs attention. There are other uses for shorter timeouts, especially in cases where you are doing clever multi-process multi-tasking, but usually in a simple database application on a proper computer you don't need that. Simon. _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

