多線程下,Python Sqlite3報[SQLite objects created in a thread can only be used...]問題


明明加了鎖保護,還是出了下面的問題

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)


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM