#16614: Support server-side cursors for queryset iteration in database backends
-------------------------------------+-------------------------------------
Reporter: Dan McGee | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: 1.3
(models, ORM) |
Severity: Normal | Resolution:
Keywords: memory cursors | Triage Stage: Accepted
database |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Tim Graham <timograham@…>):
In [changeset:"6b6be692fcd102436c7abef1d7b3fa1d37ad4bdf" 6b6be69]:
{{{
#!CommitTicketReference repository=""
revision="6b6be692fcd102436c7abef1d7b3fa1d37ad4bdf"
Refs #16614 -- Prevented database errors from being masked by cursor
close.
When an error occurred during the cursor.execute statement, the cursor
is closed. This operation did not fail with client-side cursors. Now,
with server-side cursors, the close operation might fail (example
below). The original error should be raised, not the one raised by
cursor.close(), this is only clean-up code.
For example, one can attempt to create a named cursor for an invalid
query. psycopg will raise an error about the invalid query and the
server-side cursor will not be created on PostgreSQL. When the code
attempts to cursor.close(), it asks psycopg to close a cursor that was
not created. pyscopg raises a new error: psycopg2.OperationalError:
cursor "_django_curs_140365867840512_20" does not exist.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/16614#comment:31>
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/067.7634429697369c059dbdd4825664906f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.