On 31 May 2009, at 11:56pm, John Stanton wrote: > Try studying basic database theory and technology to get a better > understanding of the problem.
I have a pretty good understanding, I think. Plus 25 years experience. > You will then understand the reason for > absolute transactional integrity and why Sqlite must use fsync or > similar and expects fsync to be a complete implementation which > ensures > that each transaction is permanently stored once a COMMIT has > succeeded. You won't be using Unix, then. I'm about to horrify you: 'man fsync' "Note that while fsync() will flush all data from the host to the drive (i.e. the "permanent storage device"), the drive itself may not physically write the data to the platters for quite some time and it may be written in an out-of-order sequence. Specifically, if the drive loses power or the OS crashes, the application may find that only some or none of their data was written. The disk drive may also re-order the data so that later writes may be present, while earlier writes are not." On Mac OS X systems, the following paragraph describes Apple's way of getting around the problem, and why PRAGMA fullsync does what it does. And the only OS it currently works on ? Apple's. And it's slow. > [snip] From the early days of IT transaction processors have been > used to > ensure data integrity. An example is the development of CICS by IBM > about 40 years or more ago. It made it possible to run important > applications on computers without requiring some form of manual system > to enforce integrity. Sqlite gives that capability to small > distributed > and embedded applications. Absolutely. With an OS designed for ACID, and all storage stuff configured to avoid cached writes, you can do a great job. That's not what the toys we bought to run Word or WoW quickly are. SQLite does a great job of changing the file contents in a consistent way. Standard hardware does not do a great job of immediately writing that file to disk. It does a great job of playing 3D games with a decent frame- rate. That's what it's designed for. Simon. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users