Xuanvinh Vu <[EMAIL PROTECTED]> wrote: > Here is what the error looks like... > > [1436] 25 Mar 16:24:24 OnEveryHour: Failure occurred while updating > the OneMonth table. Exception: System.Data.Odbc.OdbcException: ERROR > [HY000] database is locked (5) > What does the error code 5 stands for?
SQLITE_BUSY "The database file is locked" > Also I started getting the > errors when I started using transactions with my queries. I have 4 > threads which create their own connections to the DB. One thread > access the DB every 10 seconds, another every 5 minutes, another > every hour and another every day. Even if the database is locked > because of one thread shouldnt it starts working again once the > database is done with that transaction? Yes, if you wait for the lock to clear. See sqlite3_busy_timeout. The default timeout is zero meaning you get SQLITE_BUSY right away. Or, you can just retry the failed request manually after waiting for some time. > I'm doing all this from > inside a windows service. I found that once I started seeing the > errors it does not eventually correct itself like I'm expecting it > to, but I have to restart the service for it to work. Check your code, make sure all your BEGIN's are balanced by COMMIT's and you don't accidentally leave a transaction open. Also check that you close all cursors you use to read the results of the SELECT statements (e.g. you should call Close on OdbcDataReader once you are done with the resultset). Igor Tandetnik _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users