On 1 May 2012, at 3:30pm, folkert <folk...@vanheusden.com> wrote: >>> Does that mean that I can also be totally sure that the changes are on >>> the phsycical disk? >> Yes, to the extend that there is a physical disk. >> http://www.sqlite.org/transactional.html > > Yes, ok clear. If the system underneath behaves "different" then, well, > we're lost anyway.
It is worth knowing that computers of the desktop or laptop kind we use everyday do not handle ACID properly at the hardware level. For instance a standard hard disk intended for internal use will accept many 'write' commands, acknowledge them as 'done' to the operating system, but do them after the acknowledgement, sometimes not in the same order they were given. If it didn't do this, your computer would run far more slowly, since the operating system would be continually waiting for the hard disk to complete write commands. Programs like Microsoft Word would, for example, run like a pig. For a security demo I once set up a computer specially to be ACID, by changing jumper positions on the motherboard and hard disk, and it was indeed annoyingly slow to use. The only time this actually matters to you -- i.e. when it disrupts ACID -- is when hardware fails, for example when power is lost unexpectedly. >>> Does SQLite e.g. do a fsync() or sync() after it >>> executed the changes? >> Yes, or similar. >> http://www.sqlite.org/pragma.html#pragma_synchronous > > Ok. > I'm asking as I was looking at some application using SQLite which > executes an explicit sync() after each query it executes. I'm not a > database expert but I always thought that the whole idea behind > databases were that you could rely on, well, the whole ACID idea. And SQLite does ACID as well as anything can, if the hardware and operating system supports it. It doesn't need the application its running under to do sync() or fsync(), but they won't do any harm. Simon. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users