Reputation: 1598
Well normally I am using my application and there is no problem over 30000 download. but I see that This error begin to come in android developer console (Crash & ANRS).
by app version 3.1.1 1 100.0%
by Android version Android 2.3.3 - 2.3.7 1 100.0%
by device Blade (blade)
This is my code:
public void deletetable(String Tablename){
SQLiteDatabase db = mContext.openOrCreateDatabase(DB_NAME,
Context.MODE_PRIVATE, null);
db.delete(Tablename, null, null);
db.execSQL("VACUUM");
}
this is report:
java.lang.RuntimeException: An error occured while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:200)
at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:274)
at java.util.concurrent.FutureTask.setException(FutureTask.java:125)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:308)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
at java.lang.Thread.run(Thread.java:1019)
Caused by: android.database.sqlite.SQLiteDiskIOException: disk I/O error: VACUUM
at android.database.sqlite.SQLiteDatabase.native_execSQL(Native Method)
at android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:1763)
at com.restroomgames.kpss.TestAdapter.deletetable(TestAdapter.java:194)
at com.restroomgames.kpss.TrGenelSinavAnasayfa.yenile(TrGenelSinavAnasayfa.java:395)
at com.restroomgames.kpss.TrGenelSinavAnasayfa$refreshyazi.doInBackground(TrGenelSinavAnasayfa.java:381)
at com.restroomgames.kpss.TrGenelSinavAnasayfa$refreshyazi.doInBackground(TrGenelSinavAnasayfa.java:1)
at android.os.AsyncTask$2.call(AsyncTask.java:185)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
... 4 more
Upvotes: 4
Views: 8811
Reputation: 36049
From VACUUM Documentation:
The VACUUM command works by copying the contents of the database into a temporary database file and then overwriting the original with the contents of the temporary file. When overwriting the original, a rollback journal or write-ahead log WAL file is used just as it would be for any other database transaction. This means that when VACUUMing a database, as much as twice the size of the original database file is required in free disk space.
It may be that there is not enough free space available on disk to perform the VACUUM operation.
http://sqlite.org/lang_vacuum.html
Upvotes: 2
Reputation: 4531
That report probably means there's an issue writing to the DB (I/O error) on that specific users's device.
In VACCUM documentation, it's mentioned that VACCUM won't work if there are other SQL transactions in progress, so that might be the original cause.
Not much that can be done here, except surround that transaction with try/catch statement I suppose.
On a side note, VACCUM doesn't take any arguments, at least in older versions. Newer sqlite3 versions complain about a syntax error when trying to run VACCUM.
VACCUM documentation can be found here: http://sqlite.org/lang_vacuum.html
"A VACUUM will fail if there is an open transaction, or if there are one or more active SQL statements when it is run."
Upvotes: 1