On Thu, Jul 5, 2012 at 10:54 AM, Jonathan Haws <jonathan.h...@sdl.usu.edu> wrote: > I am fairly new to database development and I am working on an embedded > system where we are utilizing SQLite to manage some files and other > information that is being shared between processes. What I am doing is I > have the SQLite amalgamation source code that I am compiling into each binary > executable and each executable is opening the same database file on disk. > > My question is this: is this the appropriate way to go about this?
Yes. > Is there a better way to accomplish this task? This is good enough, considering the amount of information you gave. > If I continue down this path, are there are particular settings that I need > to set? No, you don't need any settings. > I have read through a lot of the documentation and it seems like I may want > to put the database in shared-cache mode, however that also seems to only > apply to threads within a single process. Is that correct? Correct. No need to use shared-cache mode if you use single-threaded processes. > I am also thinking that I may want to make use of the sqlite_unlock_notify() > call to ensure that if I try to write to the database and it fails to get a > lock, it will pend until it is available. However, I thought that a query > would pend until it gets a lock anyway. Is that not the case? sqlite3_unlock_notify() works only with shared-cache mode within one process. It doesn't work in inter-process locking. And by default query won't be pending until locking is possible. If you use function sqlite3_busy_timeout() you can obtain behavior close to what you want. Pavel _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users