sqla_tutorial icon indicating copy to clipboard operation
sqla_tutorial copied to clipboard

Error in Debug-Mode of PyCharm

Open elRicharde opened this issue 3 years ago • 0 comments

While Debugging 04_orm_basic in PyCharm i run into the following Error: sqlite3.ProgrammingError: SQLite objects created in a thread can only be used in that same thread. The object was created in thread id 21280 and this is thread id 32808.

The Error is raised when using lazy load pattern in line 163

While not in Debugging, or having the first Breakpoint after the lazy load it works. Also in Visual Studio everything is fine, even in debugging.

For Some Reason PyCharm is changing the Thread at this point.

I wonder now if this is only in PyCharm in Debugging or can happen in a real-world scenario as well.

Thx in advance

elRicharde avatar Feb 08 '22 20:02 elRicharde