#37000: cursor_iter relies on GC for server-side cursor cleanup, causing
transaction abort after savepoint rollback
-------------------------------------+-------------------------------------
     Reporter:  Ratskó László        |                    Owner:  (none)
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  4.2
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  iterator, server-    |             Triage Stage:  Accepted
  side-cursor, savepoint, psycopg3   |
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Simon Charette):

 * stage:  Unreviewed => Accepted

Comment:

 Accepting but I'd like to clarify a specific point.

 In your report you mention that entering the `transaction.atomic` context
 will create a ''savepoint'' but in practice that only happens if the
 `atomic` block is nested which is not included in your example.

 Can you also reproduce without using a nested transaction as the example
 you provided catches an exception inside `atomic` which
 
[https://docs.djangoproject.com/en/6.0/topics/db/transactions/#django.db.transaction.atomic
 is a documented anti-pattern]?

 We should make named cursor closing more resilient but it'd be good to
 know if this can be triggered with proper usage of `transaction.atomic`.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/37000#comment:1>
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 visit 
https://groups.google.com/d/msgid/django-updates/0107019d1b29d8df-c92754b1-a92d-4a2a-98a7-77228a15b4c5-000000%40eu-central-1.amazonses.com.

Reply via email to