Am 14.07.2014 13:53, schrieb Kees Nuyt:
> 
> On Mon, 14 Jul 2014 12:09:46 +0100, Simon Slavin <slav...@bigfraud.org>
> wrote:
> 
>> On 14 Jul 2014, at 11:19am, Kees Nuyt <k.n...@zonnet.nl> wrote:
>>
>>> On Sun, 13 Jul 2014 18:00:59 +0100, Simon Slavin <slav...@bigfraud.org>
>>> wrote:
>>>
>>>> I had to explain to some users that a database
>>>> change is not 'safe' until the database is closed.
>>>
>>> As far as I know, a database change is safe after a successfull COMMIT.
>>> Commit also releases locks.
>>
>> That's what the documentation says, and it's a safe way to
>> operate if all your access to the file is via one API.
>> Unfortunately, the drivers for many storage media lie to the
>> operating system and do not flush changes to disk when told to. 
>> On a test system running Windows 98, using a C program writing a
>> text file, I was able to prove that doing all the locking and
>> flushing the documentation required still did not properly
>> update the file on disk.  However, the file was always updated
>> by a few seconds after the file was closed so I have used that
>> as a yardstick ever since.
> 
> Aha, I see. Yes, ill-behaving filesystems can do that.
> The question is whether experiences on Windows 98 are still
> relevant for rules of thumb in 2014.
> 
As most people probably keep the write caches on their hard drives 'ON',
yes. If even your hardware lies in the name of performance, you should
probably be a little paranoid. So it is not just filesystems, it is
hardware too.

So if you do a successful commit and the OS and hardware don't lie to
you, your change is safe. But there are lies of varying magnitude at
work. So if it is really important, wait a few minutes until the OS has
surely flushed all its buffers and the HDDs did the same.

Michael

-- 
Michael Schlenker
Software Architect

CONTACT Software GmbH           Tel.:   +49 (421) 20153-80
Wiener Straße 1-3               Fax:    +49 (421) 20153-41
28359 Bremen
http://www.contact.de/          E-Mail: m...@contact.de

Sitz der Gesellschaft: Bremen
Geschäftsführer: Karl Heinz Zachries, Ralf Holtgrefe
Eingetragen im Handelsregister des Amtsgerichts Bremen unter HRB 13215
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to