Android SQL Lite fail to grow

前端 未结 2 448
我在风中等你
我在风中等你 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'
    
    0 讨论(0)
  • 2020-12-19 10:10

    I had the same problem, in my case was due to a NullPointerException by parsing the TimeZone info (unfortunately the stack trace is lost in code).

    Maybe you are affected by the same problem.

    Visit http://code.google.com/p/android/issues/detail?id=21435, I've opened an issue by google but it looks like they are not interested to the problem. The Issue is currently Declined.

    0 讨论(0)
提交回复
热议问题