Android SQL Lite fail to grow

前端 未结 2 452
我在风中等你
我在风中等你 2020-12-19 09:22

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

2条回答
  •  没有蜡笔的小新
    2020-12-19 09:52

    The CursorWindow class only supports reading 1MB of data per query:

    #define MAX_WINDOW_SIZE (1024 * 1024)
    

    (Source)

    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'
    

提交回复
热议问题