On Thu, Jul 14, 2011 at 2:36 PM, Jim Dalton <[email protected]> wrote:

> So in normal, everyday use, Django opens a connection to Postgresql with an
> open transaction. Per the docs, it commits this transaction immediately
> whenever you do an INSERT or UPDATE etc. At that point Postgresql would run
> its constraint checks and rollback the transaction on error or else commit.

Yes, each statement is a transaction in itself unless you explicitly
request an extended transaction.

> During a test, we open up a big transaction during setUp and then *disable*
> the transaction commit and rollback operations, i.e. a call to either does
> nothing. Since we can't nest transactions in Postgresql (right?) this has
> been the only sensible way to allow tests to proceed. The problem has been
> -- I am positing -- that we're getting away with a lot of stuff as a result,
> because constraint checks are *never* checked during testing. The small slew
> of bugs I found is a demonstration of that, to me.

No, sorry, nested transaction commands aren't supported.

> Anyhow, thank you once again Simon for shedding light on this for me.

No problem. Thanks to everybody working on Django.

-- 
 Simon Riggs                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to