aaugustin added the comment:
* Thesis *
I belive that using the connection as a context manager is an inadequate API
for controlling transactions because it's very likely to result in subtly
broken code.
As a consequence, my recommendation would be to deprecate this API.
* Argument
aaugustin added the comment:
> On the other hand there is absolutely nothing broken on the implicit BEGIN
> (which is required by dbapi2 specification) nor on the isolation_level
> property which controls it. Those shouldn't be touched; there is no reason to.
Nothing broken
aaugustin added the comment:
That patch solves the problem, at the cost of introducing an unwieldy API,
"operation_needs_transaction_callback".
I'm very skeptical of the other API, "in_transaction". Other database backends
usually provide an "autocommit&qu
aaugustin added the comment:
Hey -- maintainer of Django's transaction support here.
This ticket was brought to my attention again today. As I know a few things
about this issue and I see Python core devs asking for input, I'll give my
$0.02.
The core of this issue is that, **
aaugustin added the comment:
I noticed an inconsistency in the docs, and I think it falls in the "Language
Reference" section of this ticket. In the definition of the import statement,
after:
| "from" module "import" "*"
we should add:
aaugustin added the comment:
Shouldn't this be fixed in _dummy_thread too?
Attached patch contains fix + test.
(Unfortunately, I was not able to run the tests with my patch: `python3.2 -m
test.regrtest test_dummy_thread` tests my 'system' version, not my svn
checkout. I did
aaugustin added the comment:
I agree with your solution. Unfortunately, I do not know how you would redefine
ThreadError to extend RuntimeError in a C extension.
_thread.error is created line 741 in trunk/Modules/threadmodule.c:
ThreadError = PyErr_NewException("thread.error",
New submission from aaugustin :
The docs for the threading module state that:
> The release() method should only be called in the locked state; it changes
> the state to unlocked and returns immediately. If an attempt is made to
> release an unlocked lock, a RuntimeError will