#10813: Database errors in the shell should roll back the transaction
-------------------------------------+-------------------------------------
     Reporter:  Glenn                |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  SVN
  (models, ORM)                      |               Resolution:
     Severity:  Normal               |             Triage Stage:  Accepted
     Keywords:                       |      Needs documentation:  0
    Has patch:  1                    |  Patch needs improvement:  1
  Needs tests:  0                    |                    UI/UX:  0
Easy pickings:  0                    |
-------------------------------------+-------------------------------------

Comment (by Glenn):

 > Can you explain the rationale behind that? If _anything_ inside my
 transaction gives me an error which I had not anticipated (otherwise I
 should have used a savepoint) it should just rollback the entire
 transaction. Just allowing new commands like nothing has happened can
 easily cause data loss and goes directly against ACID compliance.

 Nothing says that errors are unexpected.  If an unexpected error does
 happen, it's the application's job to roll back the transaction; it's
 *not* the database's job to *force* it to.

 > No, the correct fix is to make Django default to AutoCommit? settings
 with Postgres. If you want to continue running commands after your
 transaction has died than you shouldn't be using transactions in the first
 place.

 That doesn't make sense.  Of course I should be using transactions.

 > My proposed fix, make autocommit the default setting for postgres.

 The default behavior should not vary across databases.

 I don't intend to debate this further, since this bug has sat around for
 well over three years (despite having a reasonable fix available for at
 least the most common and annoying problem), giving me little expectation
 of it getting fixed, and I'm not even using Django for anything right now.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/10813#comment:11>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

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

Reply via email to