I have a long running app that I have updated over the years as things have changed but this error causes my sql_lite database to die and become corrupt. Basically failing when it updates a blob field in a SQL database file under Android 8.1 (Oreo) on Samsung tablets.
Its not random and happens on the same images of the set retrieved over http services which appear to get the images just fine. There is nothing that distinguishes why certain images fail to update properly. They can be large, small, have a lot of detail or none, but its always the same images that don't update. When it fails, the database becomes corrupted which is to say the application is done for.
The code is similar to many samples, and I don't think this is a code issue so much as a sql1.5 issue under android 8.1
Any help or insight would be appreciated.
>> IMG (image)
android.database.sqlite.SQLiteDatabaseCorruptException: database disk image is malformed (code 11)
Error Code : 11 (SQLITE_CORRUPT)
Caused By : The database disk image is malformed.
(database disk image is malformed (code 11))
Thanks for any insight
Its not random and happens on the same images of the set retrieved over http services which appear to get the images just fine. There is nothing that distinguishes why certain images fail to update properly. They can be large, small, have a lot of detail or none, but its always the same images that don't update. When it fails, the database becomes corrupted which is to say the application is done for.
The code is similar to many samples, and I don't think this is a code issue so much as a sql1.5 issue under android 8.1
Any help or insight would be appreciated.
>> IMG (image)
B4X:
Dim Buffer() As Byte
Try
Dim OPSTR As OutputStream
OPSTR.InitializeToBytesArray (1000)
IMG.WriteToStream(OPSTR, 90, "JPEG")
Buffer = OPSTR.ToBytesArray
OPSTR.Close
IMG=Null
Catch
ToastMessageShow("Failed image.", True)
Return
End Try
Dim SQLSTR As String = "UPDATE UserImages SET ImageBlob=? WHERE ImageId=?
Try
SQL1.ExecNonQuery2(SQLSTR, Array As Object(Buffer, ImageId))
Catch
Log(LastException)
End Try
android.database.sqlite.SQLiteDatabaseCorruptException: database disk image is malformed (code 11)
Error Code : 11 (SQLITE_CORRUPT)
Caused By : The database disk image is malformed.
(database disk image is malformed (code 11))
Thanks for any insight
Last edited: