niwinz / djorm-ext-core

Core module of django orm extensions package. (Collection of third party plugins build in one unified package)
Other
27 stars 8 forks source link

Fixed multi-threading problem where `_local_data` attributes will only be seen by thread that imports the module. #2

Closed oinopion closed 11 years ago

oinopion commented 11 years ago

To reproduce this bug just create basic django view that uses server side cursors and serve it using threaded runserver (default in 1.5). First hit is OK, but subsequent ones are raise AttributeError. As attributes of this object are local to thread, other thread will not see default values set during module import.

Side note: global declarations are unnecessary in this case.

niwinz commented 11 years ago

Thanks!