On 7 Nov 2017, at 6:53pm, David Raymond <david.raym...@tomtom.com> wrote:

> I think pragma data_version is what you're looking for.
> http://www.sqlite.org/pragma.html#pragma_data_version

An excellent solution, though there’s a /caveat/.  From the original post:

> Right now everything's a single process, so it's really easy, just clear
> the cache on every write. However, I want to be prepared for the near
> future where I will have multiple processes using this db file.

Documentation for the PRAGMA says

" The "PRAGMA data_version" value is a local property of each database 
connection and so values returned by two concurrent invocations of "PRAGMA 
data_version" on separate database connections are often different even though 
the underlying database is identical. "

So when you convert your code to use multiple processes, they must all use the 
same connection for this to work properly.  That means you will have to invent 
a method to ensure that only one of them makes changes at a time.  That might 
not be what you wanted to do.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to