michaelliao/transwarp — pull request #1 by help-lazybones (2013-03-09 10:10:59+00:00)
Title: bug:connection close after line 'with transaction as tran:'

def transaction():
with connection():
return _Transaction()

observed:
after _Transaction() returned, the __exit__ method of _Connection will be called.

The fix is simple. In __enter__ method of _Transaction(), call _db_ctx.init().
The should_cleanup attr of _Connection is also removed. Because there is no way
to set the value of should_cleanup in _Transaction().