SQLite3 check for locked. lazarus / 16-Databases ---------------------------------------------------------------------- chrnobel · 2012-01-16 23:48 Hi all. Albeit SQLite3 is a single user database, it is quite usable as a (smaller) multiuser database, if it primarily is going to be used for reads. However in my application I do have some writes which gives me concurrency problems, however they should be to overcome if just waiting a little while, as a typical transaction takes less than 100ms. But sometimes it goes wrong if trying to read at exactly the same time as a write is being committed, so is there some way to check the SQLite3connection for whether the database is locked, so instead of raising an error I just can wait eg. 100 ms, and then try again? Tnx Christain ---------------------------------------------------------------------- LuizAmérico · 2012-01-17 00:48 Try using sqlite3_busy_timeout  or add a busy handler (see docs in site) ---------------------------------------------------------------------- LuizAmérico · 2012-01-17 00:49 Also you can use the new wal mode: http://www.sqlite.org/wal.html ---------------------------------------------------------------------- chrnobel · 2012-01-17 08:05 Quote from: LuizAmérico on January 17, 2012, 01:48:36 amTry using sqlite3_busy_timeoutIs this a FPC property? Quote  (see docs in site)Which docs? ---------------------------------------------------------------------- Lacak2 · 2012-01-19 05:20 Quote from: chrnobel on January 17, 2012, 09:05:15 amQuote from: LuizAmérico on January 17, 2012, 01:48:36 amTry using sqlite3_busy_timeoutIs this a FPC property? No it is SQLite3 API function: http://www.sqlite.org/c3ref/busy_timeout.html Quote from: chrnobel on January 17, 2012, 09:05:15 amQuote  (see docs in site)Which docs? http://www.sqlite.org/c3ref/intro.html