Xof/xact — pull request #2 by kylemacfarlane (2012-05-17 12:06:32+00:00)
Title: Simple thread safety fix + a more reliable way to check if managed

This includes two fixes.

1) The current SID is now thread local.

2) 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 you really need to just patch Django proper.