xact
xact copied to clipboard
Simple thread safety fix + a more reliable way to check if managed
This includes two fixes.
-
The current SID is now thread local.
-
More sensible behaviour if for some reason autocommit is off but this decorator is in use.
When I use this decorator I also remove the custom _leave_transaction_management
. Django itself sometimes starts transactions within the ORM and this fix does not cover those occasions. Placing a fix in this decorator gives people false hope when they really need to just patch Django proper.