Hi Raymond, this looks very similar to problems I'm having. I am also writing to and querying a sqlite database which will work fine for hours, do hundreds of operations and then all of a sudden, throw a sqlitedatabasecorrupt exception randomly at a statement that has previously been fine. I can't see any pattern to the behaviour at the moment so was wondering, did you find a solution to this? Thanks in advance,
Cliff On Feb 25, 10:31 am, Raymond <[email protected]> wrote: > Hi, > We develop since severals monthes a professional application that > allows us to graphicaly design and generate an android application to > collect data. > This application allows to synchronize data between the android > application and a remote server. The data are stored localy on > aSQLitedatabase. We used theSQLiteandroid API to manipulate it. > > We experience a problem which is not reproducible on demand, sometime > we got an SQLiteDatabaseCorruptException, and so android destroys > thisdatabaseand creates a new one which of course is empty. This error > appears randomly in the code when we are dealing with thedatabase. As > sample the last one was : > > SQLiteStatement stat = db.compileStatement(....); <- No error > long date = 0; > try { > date = stat.simpleQueryForLong(); > } catch (Exception e) { > date = 0; > } > stat.close(); > Cursor c = db.query(......); <- No error > if(c.getCount()>0){ <- SQLiteDatabaseCorruptException > thrown on the getCount() > .... > > } > > _____________________________________________________________________________________________________ > 02-25 03:45:25.091 D/OpenSSLSessionImpl(22200): Freeing OpenSSL > session > 02-25 03:45:25.991 E/Database(22200): Removing corruptdatabase: /data/ > data/fr.medes.medoo.android/databases/medoo > 02-25 03:45:26.031 E/ > fr.medes.medoo.android.synchronization.OptimizedSynchronizationService(22200): > error during synchronization > 02-25 03:45:26.031 E/ > fr.medes.medoo.android.synchronization.OptimizedSynchronizationService(22200): > android.database.sqlite.SQLiteDatabaseCorruptException:databasedisk > image is malformed > 02-25 03:45:26.031 E/ > fr.medes.medoo.android.synchronization.OptimizedSynchronizationService(22200): > at android.database.sqlite.SQLiteQuery.native_fill_window(Native > Method) > 02-25 03:45:26.031 E/ > fr.medes.medoo.android.synchronization.OptimizedSynchronizationService(22200): > at android.database.sqlite.SQLiteQuery.fillWindow(SQLiteQuery.java: > 75) > 02-25 03:45:26.031 E/ > fr.medes.medoo.android.synchronization.OptimizedSynchronizationService(22200): > at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java: > 288) > 02-25 03:45:26.031 E/ > fr.medes.medoo.android.synchronization.OptimizedSynchronizationService(22200): > at android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java: > 269) > 02-25 03:45:26.031 E/ > fr.medes.medoo.android.synchronization.OptimizedSynchronizationService(22200): > at > fr.medes.medoo.android.synchronization.OptimizedSynchronizationService.getDataToSynchronize(OptimizedSynchronizationService.java: > 474) > 02-25 03:45:26.031 E/ > fr.medes.medoo.android.synchronization.OptimizedSynchronizationService(22200): > at > fr.medes.medoo.android.synchronization.OptimizedSynchronizationService.run(OptimizedSynchronizationService.java: > 244) > 02-25 03:45:26.031 E/ > fr.medes.medoo.android.synchronization.OptimizedSynchronizationService(22200): > at java.lang.Thread.run(Thread.java:1060) > ______________________________________________________________________________________________________ > > This code is part of the synchronization service and it has been > executed correctly hundreds time before in the same process without > problem. > This code is embedded in a service and there is only one thread > accessing thedatabaseat this time. > > Did somebody experience this kind of error ? Any help would be > appreciate. > > Thanks, -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

