-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 14/01/16 00:44, sanhua.zh wrote: > Recently, my monitoring system showed that the error code > SQLITE_FULL and SQLITE_CORRUPT increasing in same trend.
Just as another data point, I had SQLite using code in a library that was used across a bunch of third party apps, with many millions of installations on Android, and to a lesser degree on iOS. (I stored analytics events in a SQLite database and periodically uploaded them in batches.) Although there were Android devices (the really cheap and nasty ones) that kept running out of space, not once was there corruption. I was very careful to use transactions, and pay attention to the return code of API calls. SQLite is unlikely to have problems: https://sqlite.org/testing.html > This is happened in iOS. The OS will automatically clean the disk > cache to make some space while disk free space is low Android does the same. One thing you have to be *very* careful about on iOS (and current Android) is exactly where you place the database files in your app sandbox. Most of the directory tree is backed up, but you don't have direct control over when that happens, or the restore. If you put the database files in a location that is backed up and restored, then it is possible for the database and its journal to be inconsistent with each other. https://developer.apple.com/library/ios/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/FileSystemOverview/FileSystemOverview.html Using WAL will make you less sensitive to these issues. Roger -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlaXxrQACgkQmOOfHg372QRqzwCfT+Mv9QjLVccydsj0c5wuKq9H bdIAmQF2BFMzJqXXyxSgvdDeVt8/3j3y =3tnu -----END PGP SIGNATURE-----