Android SQLite error code 21

后端 未结 1 724
遥遥无期
遥遥无期 2021-01-13 13:10

I\'ve gotten the following error in the log files of my emulator and I don\'t know what to make of it because a google search turns up nothing.

03-12 12:53:2         


        
相关标签:
1条回答
  • 2021-01-13 13:31

    I found

    #define SQLITE_MISUSE      21   /* Library used incorrectly */
    

    in the SQLite C/C++ interface documentation.

    This error might occur if one or more of the SQLite API routines is used incorrectly. Examples of incorrect usage include calling sqlite_exec after the database has been closed using sqlite_close or calling sqlite_exec with the same database pointer simultaneously from two separate threads.

    I'd guess that means your code is calling the interface library incorrectly around line 95716.

    Later . . .

    The OP confirmed that the actual problem involved two threads accessing the database at the same time, one trying to write to the db, and the other trying to close it. I'd infer from this that the offending line of code, 95716, was in the emulator. (Because the OP's code base had only 1000 lines or less.)

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