VACUUM cannot run within a transaction

This commit is contained in:
M66B 2016-02-13 13:15:43 +01:00
parent baf5df686c
commit 945a9e0f33
1 changed files with 2 additions and 1 deletions

View File

@ -373,12 +373,13 @@ public class DatabaseHelper extends SQLiteOpenHelper {
db.beginTransactionNonExclusive(); db.beginTransactionNonExclusive();
try { try {
db.delete("log", null, new String[]{}); db.delete("log", null, new String[]{});
db.execSQL("VACUUM");
db.setTransactionSuccessful(); db.setTransactionSuccessful();
} finally { } finally {
db.endTransaction(); db.endTransaction();
} }
db.execSQL("VACUUM");
} finally { } finally {
mLock.writeLock().unlock(); mLock.writeLock().unlock();
} }