Вызвано java.lang.IllegalStateException: Не удалось прочитать строку 281, столбец 0 из CursorWindow с комнатой - PullRequest
0 голосов
/ 21 января 2019

Я получаю это исключение с моим DAO в комнате, в случайные моменты:

Caused by java.lang.IllegalStateException
Couldn't read row 281, col 0 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it.
android.database.CursorWindow.nativeGetString (CursorWindow.java)
android.database.CursorWindow.getString (CursorWindow.java:460)
android.database.AbstractWindowedCursor.getString (AbstractWindowedCursor.java:51)
com.myapp.android.model.db.PlacesDao_Impl$6.call (PlacesDao_Impl.java:734)
io.soulpicks.android.model.db.PlacesDao_Impl$6.call (PlacesDao_Impl.java:693)
android.arch.persistence.room.RxRoom$4.apply (RxRoom.java:111)
android.arch.persistence.room.RxRoom$4.apply (RxRoom.java:108)
io.reactivex.internal.operators.flowable.FlowableMap$MapConditionalSubscriber.tryOnNext (FlowableMap.java:124)
io.reactivex.internal.operators.flowable.FlowableObserveOn$ObserveOnConditionalSubscriber.runAsync (FlowableObserveOn.java:637)
io.reactivex.internal.operators.flowable.FlowableObserveOn$BaseObserveOnSubscriber.run (FlowableObserveOn.java:176)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1113)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:588)
java.lang.Thread.run (Thread.java:818)

Видел, как Crashlytics сообщал об этом несколько раз на нескольких устройствах, но я сам не сталкивался с ошибкой.

Это мой класс PlaceDao:

@Dao
interface PlacesDao {

    @Query("select * from Places where placeId = :id")
    fun getPlace(id: String): Flowable<Place>

    @Query("select * from Places where placeId in (:placesIds) order by distance, placeName ASC")
    fun getPlaces(placesIds: List<String>): Flowable<List<Place>>

    @Query("select * from Places join list_results where Places.placeId = list_results.id order by distance, placeName ASC")
    fun getFilteredPlaces(): Flowable<List<Place>>

    @Query("select * from Places where placeId = :id")
    fun forId(id: String) : Place

    @Query("select * from Places where placeId in (:placesIds)")
    fun forIds(placesIds: List<String>): List<Place>


    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun savePlaces(places: List<Place>)

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun savePlace(place: Place)

    @Query("DELETE from Places")
    fun deleteAll()


    @Query("select * from Places")
    fun getAll(): Single<List<Place>>


    @Query("select * from Places where (experienceId IS NOT NULL) AND (experienceId != '') order by placeName")
    fun getMyPlaces(): Flowable<List<Place>>


    @Query("update Places set distance = :distance where placeId = :id")
    fun updateDistance(id: String, distance: Float)
}

У меня проблемы с выяснением, как отладить его, не говоря уже об устранении проблемы!

...