Android SQLite Error Code 21

I got the following error in the log files of my emulator, and I do not know what to do with it, because Google search does not appear.

03-12 12:53:28.782: INFO/Database(688): sqlite returned: error code = 21, msg = misuse detected by source line 95716 03-12 12:53:28.812: ERROR/Database(688): sqlite_config failed error_code = 21. THIS SHOULD NEVER occur. 
+4
source share
1 answer

I found

 #define SQLITE_MISUSE 21 /* Library used incorrectly */ 

in the SQLite C / C ++ documentation.

This error may occur if one or more of the SQLite API procedures is incorrect. Examples of improper use include calling sqlite_exec after closing the database using sqlite_close or calling sqlite_exec with the same database pointer at the same time as two separate threads.

I would suggest that your code incorrectly calls the interface library around line 95716.

Later.,.

The OP confirmed that the actual problem is that two threads are accessing the database at the same time, one is trying to write to db, and the other is trying to close it. I would conclude that there was an offensive line of code 95716 in the emulator. (Because the OP code base had only 1000 lines or less.)

+8
source

Source: https://habr.com/ru/post/1343475/


All Articles