[EMAIL PROTECTED] wrote: Bud Beacham wrote: > Yes. This is a bug, but I have not filed it yet. The problem is that the the > Tcl errorcode command does not return a 5 (SQLITE_BUSY) when the DB is in > use. Instead, Tcl crashes with a "database locked" message. > For example, > sqlite dbCmd $dataBase > dbCmd timeout 3000 > set qryResult [dbCmd eval $query] > set errorCode [dbCmd errorcode] > dbCmd close > > So this means that instead of checking the errorcode to try again on a locked > DB you need to enclose everything in a "catch" statement, and check the > "catch" for an error. >
The current behavior is by design. It is as intented. It is the "TCL way" to throw an exception when something goes wrong, and encountering an SQLITE_BUSY error counts as something going wrong. That's great if it were documented. Rather, the documentation implies that errorcode should return a 5, and then the program should handle it. Personally, a database being busy does not, in my mind, constitute something going wrong. It is expected behaviour, and should be handled in a normal manner; i.e. errorcode returns a 5.