代码改变世界

多线程下,Python Sqlite3报[SQLite objects created in a thread can only be used...]问题

2013-07-31 18:45  江湖么名  阅读(6515)  评论(1)    收藏  举报

明明加了锁保护,还是出了下面的问题

ProgrammingError: SQLite objects created in a thread can only be used in that same thread.The object was created in thread id 4460 and this is thread id 7608

解决方式: 

    sqlite3.connect(fp,check_same_thread = False)