#12171: transaction.rollback_savepoint fails with postgresql database backend
------------------------------------------+---------------------------------
 Reporter:  andrewbadr                    |       Owner:  nobody    
   Status:  new                           |   Milestone:            
Component:  Database layer (models, ORM)  |     Version:  1.1       
 Keywords:                                |       Stage:  Unreviewed
Has_patch:  0                             |  
------------------------------------------+---------------------------------
 Calls to transaction.rollback_savepoint fail because they try to create a
 new cursor, which executes "SET client_encoding to 'UNICODE'" inside the
 already failed transaction. This is in 1.1 and trunk (r11724).

 To repro: create a project w/the "postgresql" database backend, and do
 `python runtests.py get_or_create`.

 Example traceback:
 {{{
  File "/var/www/yourworld/ywot/views.py", line 136, in send_edits
    tile, _ = Tile.objects.get_or_create(world=world, tileY=tileY,
 tileX=tileX)

  File "/usr/local/lib/python2.6/dist-
 packages/django/db/models/manager.py", line 123, in get_or_create
    return self.get_query_set().get_or_create(**kwargs)

  File "/usr/local/lib/python2.6/dist-packages/django/db/models/query.py",
 line 339, in get_or_create
    transaction.savepoint_rollback(sid)

  File "/usr/local/lib/python2.6/dist-packages/django/db/transaction.py",
 line 199, in savepoint_rollback
    connection._savepoint_rollback(sid)

  File "/usr/local/lib/python2.6/dist-
 packages/django/db/backends/__init__.py", line 67, in _savepoint_rollback
    self.cursor().execute(self.ops.savepoint_rollback_sql(sid))

  File "/usr/local/lib/python2.6/dist-
 packages/django/db/backends/__init__.py", line 81, in cursor
    cursor = self._cursor()

  File "/usr/local/lib/python2.6/dist-
 packages/django/db/backends/postgresql/base.py", line 127, in _cursor
    cursor.execute("SET client_encoding to 'UNICODE'")

 ProgrammingError: ERROR:  current transaction is aborted, commands ignored
 until end of transaction block

 SET client_encoding to 'UNICODE'
 }}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/12171>
Django <http://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