ORMLite IllegalStateException异常当有许多记录(ORMLite Ille

2019-10-21 08:05发布

我使用的是QueryBuilder的一个地方做一个选择。 它的POJO的表和一般已经为众多用户的长时间运作良好。

ArrayList<X> result = new ArrayList<X>();
QueryBuilder<X, Integer> queryBuilder = getXDao().queryBuilder();
Where<X, Integer> where = queryBuilder.where();
where.eq(X, x);
queryBuilder.orderBy(X, true);

result = (ArrayList<X>)getXDao().query(queryBuilder.prepare());

有一种独特的谁崩溃每次查询该表由于以下ORMLite例外时间:

java.lang.IllegalStateException: Couldn't read row 1060, col 0 from CursorWindow.  Make sure the Cursor is initialized correctly before accessing data from it.
       at android.database.CursorWindow.nativeGetLong(CursorWindow.java)
       at android.database.CursorWindow.getLong(CursorWindow.java:512)
       at android.database.CursorWindow.getInt(CursorWindow.java:579)
       at android.database.AbstractWindowedCursor.getInt(AbstractWindowedCursor.java:69)
       at com.j256.ormlite.android.AndroidDatabaseResults.getInt(AndroidDatabaseResults.java:169)
       at com.j256.ormlite.field.types.IntegerObjectType.resultToSqlArg(IntegerObjectType.java:37)
       at com.j256.ormlite.field.BaseFieldConverter.resultToJava(BaseFieldConverter.java:24)
       at com.j256.ormlite.field.FieldType.resultToJava(FieldType.java:799)
       at com.j256.ormlite.stmt.mapped.BaseMappedQuery.mapRow(BaseMappedQuery.java:60)
       at com.j256.ormlite.stmt.SelectIterator.getCurrent(SelectIterator.java:270)
       at com.j256.ormlite.stmt.SelectIterator.nextThrow(SelectIterator.java:161)
       at com.j256.ormlite.stmt.StatementExecutor.query(StatementExecutor.java:199)
       at com.j256.ormlite.dao.BaseDaoImpl.query(BaseDaoImpl.java:263)
       at com.j256.ormlite.dao.RuntimeExceptionDao.query(RuntimeExceptionDao.java:213)

我已经看到了,对于中型或大型的表,那么可能会更好使用迭代器的文档中说明。 我的问题是,如果该行数将被视为“中型或大型”。 我本来以为不会。 此外,我创造了比这个更大的表,没有看到这个问题

没有任何人有什么可能会导致这或之前见过类似的东西有何建议? 利空数据可能?

文章来源: ORMLite IllegalStateException when there are many records