#32248: QuerySet.get() leaves postgres in 'current transaction is aborted...' 
state
if invalid data is passed.
-------------------------------------+-------------------------------------
     Reporter:  Asit Kumar Singh     |                    Owner:  Nayan
                                     |  sharma
         Type:  Bug                  |                   Status:  closed
    Component:  Database layer       |                  Version:  2.2
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:  invalid
     Keywords:  postgres             |             Triage Stage:
  transaction_aborted                |  Unreviewed
  get_object_or_404                  |
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

 * status:  assigned => closed
 * resolution:   => invalid
 * component:  Utilities => Database layer (models, ORM)
 * easy:  1 => 0


Comment:

 `get_object_or_404()` calls `QuerySet.get()` without anything fancy, so
 it's not related with its implementation. It looks that you call
 `invalid_data()` inside an atomic transaction, in such cases you shouldn't
 catch exceptions, see
 
[https://docs.djangoproject.com/en/3.1/topics/db/transactions/#django.db.transaction.atomic
 ""Avoid catching exceptions inside atomic!""]. If it's not the case,
 please provide a sample Django 3.1+ project that reproduces this issue
 (Django 2.2 doesn't receive bugfixes anymore).

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32248#comment:4>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.169d9d2f173505777552207b2337ac48%40djangoproject.com.

Reply via email to