[Interest] sqlite

Bo Thorsen bo at vikingsoft.eu
Fri Apr 17 14:47:58 CEST 2015


On 04/17/2015 02:36 PM, André Somers wrote:
> Bo Thorsen schreef op 17-4-2015 om 14:24:
>> On 04/17/2015 02:10 PM, André Somers wrote:
>>> 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.
>> This contradicts the info on the sqlite website. They claim that it's
>> possible to do exactly this. Interesting that you disagree.
> In practice, we found that it results in problems in practise, even if
> it may work in theory. Perhaps it is due to the actual sqlite, perhaps
> it is due to the fact that it really is just a file and it is the
> (networked) file access that is to blame in the end in our case, but the
> problems are real.

According to the same documentation, it does not work if the file is on 
a networked file system. So if the OP use a local file system only, then 
it might still work.

Bo Thorsen,
Director, Viking Software.

-- 
Viking Software
Qt and C++ developers for hire
http://www.vikingsoft.eu



More information about the Interest mailing list