简体   繁体   English

无法读取第 0 行 sqlite 数据库

[英]Failed to read row 0 sqlitedatabase

How to fix it?如何解决?

W/CursorWindow: Window is full: requested allocation 2108731 bytes, free space 17752 bytes, window size 2097152 bytes
W/CursorWindow: Window is full: requested allocation 2108731 bytes, free space 2096480 bytes, window size 2097152 bytes
E/CursorWindow: Failed to read row 0, column 0 from a CursorWindow which has 0 rows, 9 columns.

You are storing row data (typically one of the columns contains a media object (eg an image) as a blob) in the database that is too large to be handled by the Cursor.您在数据库中存储的行数据(通常其中一列包含一个作为 blob 的媒体对象(例如图像))太大而无法由 Cursor 处理。 That is an attempt is being made to retrieve 2108731 bytes which is beyond the 2M (2097152 bytes) allocated to a Cursor Window.这是试图检索2108731字节,这超出了分配给光标窗口的 2M(2097152 字节)。

You cannot use the android SDK's Cursor methods (without modification) to retrieve such a large amounts of data, even though you can store such an amount.您不能使用android SDK 的Cursor 方法(未经修改)来检索如此大量的数据,即使您可以存储如此多的数据。

The fix is to store that data behind the blob (generally images) as a file and to then store a reference to the file (eg it's path or part thereof) in the database.解决方法是将该数据作为文件存储在 blob(通常是图像)后面,然后在数据库中存储对该文件的引用(例如,它的路径或其中的一部分)。

This link has examples (based on images) and a more comprehensive overview of the issue.链接包含示例(基于图像)和更全面的问题概述。

Alternately, this shows a way you could store such an image or images by splitting the data in parts.或者, 显示了一种可以通过将数据分成几部分来存储这样一个或多个图像的方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM