[Interest] sqlite

André Somers andre at familiesomers.nl
Fri Apr 17 14:10:13 CEST 2015


Bo Thorsen schreef op 17-4-2015 om 13:48:
> On 04/17/2015 10:25 AM, Graham Labdon wrote:
>> Hi
>> My application makes use of an sqlite database that needs to be shared amongst
>> multiple instantiations of the application.
>> Can  anyone please suggest how I can implement this such that if one
>> instantiation of the application updates the database then any other
>> instantiations that are running get notified.
> You can't do this. There is no mechanism in sqlite to notify other
> applications that something has changed. You are going to have to
> implement an IPC system for this.
>

In fact: don't do that at all. Don't use sqlite for simultanious access 
by several processes. We did (against recommendation of the engineers, 
management forced a 'quick fix' to get a feature in), and we're still 
sorry for it. You'll end up in hack-upon-hack to make it sort-of-work, 
but it is no end of pain and sooner or later will end up in data 
corruption in your data base. Sqlite is very nice as a small, local, 
simple database, but it is no replacement for running a real database 
server. If you need concurrent access by multiple processes, use a 
database that is built for that kind of thing. MySql, PostgreSql, whatever.

André




More information about the Interest mailing list