Android的SQL精简版无法成长 [英] Android SQL Lite fail to grow
问题描述
我们正在创建一个应用程序与服务器同步一次5000日历项。问题是,1913年加入条目后失败,并给出以下堆栈跟踪。这是什么问题?
11月12日至三十日:48:16.989:DEBUG / dalvikvm(384):GC_EXPLICIT释放5699对象/在579ms 345848字节 11月12日至三十日:48:22.530:DEBUG / dalvikvm(232):GC_EXPLICIT释放2552对象/在311ms 124160字节 11月12日至三十日:48:24.560:ERROR / CursorWindow(232):需要成长:MSIZE = 1048576,大小= 414,自由空间()= 328,= numRows行1913年 11月12日至三十日:48:24.599:ERROR / CursorWindow(232):没有增长,因为已经有1913年的行(S),最大大小1048576 11月12日至三十日:48:24.599:ERROR / CursorWindow(232):该行失败,所以背出新行从allocRowSlot 1912年会计 11月12日至三十日:48:24.620:ERROR /光标(232):未能分配fieldDir在startPos 1912年行0 11月12日至三十日:48:27.340:DEBUG /光标(232):finish_program_and_get_row_count行3266 11月12日至三十日:48:28.070:错误/日历(维卡斯)(384):在EasSyncServicejava.lang.NullPointerException未捕获异常 11月12日至三十日:48:28.089:错误/日历(维卡斯)(384):同步结束,由于异常。
在 CursorWindow
类只支持读取每个查询1MB的数据:
的#define MAX_WINDOW_SIZE(1024 * 1024)
<一个href="http://www.google.com/$c$csearch/p?hl=en#uX1GffpyOZk/core/jni/CursorWindow.h&q=MAX_WINDOW_SIZE&sa=N&cd=1&ct=rc">(Source)
请尝试以下的一种或多种:
- 在请求较少的行。
- 在请求更少的列。
- 在分裂您查询成更小的查询,并在同一时间运行它们。
可以改善这种状况的方法之一是存储最后同步日期在服务器上,仅同步发生自该日期的变化。
SELECT *
从日历
在修改过的&GT; 有些日子
We are creating an app that syncs 5000 calendar entries with the server. The issue is that after adding 1913 entries it failing and giving the following stack trace. What is the problem?
12-30 11:48:16.989: DEBUG/dalvikvm(384): GC_EXPLICIT freed 5699 objects / 345848 bytes in 579ms 12-30 11:48:22.530: DEBUG/dalvikvm(232): GC_EXPLICIT freed 2552 objects / 124160 bytes in 311ms 12-30 11:48:24.560: ERROR/CursorWindow(232): need to grow: mSize = 1048576, size = 414, freeSpace() = 328, numRows = 1913 12-30 11:48:24.599: ERROR/CursorWindow(232): not growing since there are already 1913 row(s), max size 1048576 12-30 11:48:24.599: ERROR/CursorWindow(232): The row failed, so back out the new row accounting from allocRowSlot 1912 12-30 11:48:24.620: ERROR/Cursor(232): Failed allocating fieldDir at startPos 0 row 1912 12-30 11:48:27.340: DEBUG/Cursor(232): finish_program_and_get_row_count row 3266 12-30 11:48:28.070: ERROR/Calendar(Vikas)(384): Uncaught exception in EasSyncServicejava.lang.NullPointerException 12-30 11:48:28.089: ERROR/Calendar(Vikas)(384): Sync ended due to an exception.
The CursorWindow
class only supports reading 1MB of data per query:
#define MAX_WINDOW_SIZE (1024 * 1024)
Try one or more of the following:
- Request fewer rows.
- Request fewer columns.
- Split your query up into smaller queries and run them one at a time.
One way you could improve the situation is to store the last sync date on the server and only synchronize changes that have happened since that date.
SELECT *
FROM calendar
WHERE modified > 'some date'
这篇关于Android的SQL精简版无法成长的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!