Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQLiteFullException: database or disk is full (code 13) GreenDao

how to solving SQLiteFulException in greenDao when I delete record from table?

this is my stacktrace :

android.database.sqlite.SQLiteFullException: database or disk is full (code 13)
at android.database.sqlite.SQLiteConnection.nativeExecute(Native Method)
at android.database.sqlite.SQLiteConnection.execute(SQLiteConnection.java:555)
at android.database.sqlite.SQLiteSession.endTransactionUnchecked(SQLiteSession.java:437)
at android.database.sqlite.SQLiteSession.endTransaction(SQLiteSession.java:401)
at android.database.sqlite.SQLiteDatabase.endTransaction(SQLiteDatabase.java:522)
at de.greenrobot.dao.AbstractDao.deleteInTxInternal(AbstractDao.java:613)
at de.greenrobot.dao.AbstractDao.deleteInTx(AbstractDao.java:623)

this is my code for delete record from database :

QueryBuilder<TaskD> qb = getTaskDDao(context).queryBuilder();
qb.where(TaskDDao.Properties.Uuid_task_h.eq(keyTaskH));
qb.build();
getTaskDDao(context).deleteInTx(qb.list());
getDaoSession(context).clear();
like image 459
Gigin Ginanjar Avatar asked Jun 16 '16 07:06

Gigin Ginanjar


2 Answers

This is unrelated to greenDAO. If your disk is full, it is full. You ran out of disk space. Depending on what you do, running VACUUM SQLite occasionally may defrag your DB.

like image 73
Markus Junginger Avatar answered Nov 09 '22 18:11

Markus Junginger


From SQLite documentation

(13) SQLITE_FULL

The SQLITE_FULL result code indicates that a write could not complete because the disk is full. Note that this error can occur when trying to write information into the main database file, or it can also occur when writing into temporary disk files. Sometimes applications encounter this error even though there is an abundance of primary disk space because the error occurs when writing into temporary disk files on a system where temporary files are stored on a separate partition with much less space that the primary disk. https://www.sqlite.org/rescode.html#full

I guess application is installed on SDCARD or something.

like image 31
Abhijit Chakra Avatar answered Nov 09 '22 19:11

Abhijit Chakra