Getting Random android.database.sqlite.SQLiteBlobTooBigException

前端 未结 1 632
礼貌的吻别
礼貌的吻别 2021-01-16 13:03

I am using Room in my app as a Single Source of Truth, so everything that comes from the backend I save in my room database, which then returns a Flowable that fires an even

相关标签:
1条回答
  • 2021-01-16 13:33

    I found how to use length() and substr() to request only 1MB (the max for CursorWindow is 2MB), maybe it will help. (in your case you could simply divide the requests into chunks of 100 rows and then close the cursor, then repeat) It seems that you are storing images, in which case it would be better to store them in internal storage, and only store the file path in the database.

    Especially when sometimes exactly the same data will be returned without a problem?

    If you mean exactly the same rows (like the rows from 1000 to 2000), but from different devices, it might be the case that they have different "max-sizes" for the CursorWindow, in my case it seems to be 2MB.

    0 讨论(0)
提交回复
热议问题