I've run into the following error in a SQL DB envornment and was
wondering if any one else had run into problems with Deadlocking with
MySQL. What would be the proper way to handle this kind of error in
Django?

Do most folks simply catch the OperationalError and show some sort of
error to the user?

...
File "/usr/local/lib/python2.5/site-packages/django/db/models/manager.py",
line 99, in create
   return self.get_query_set().create(**kwargs)

 File "/usr/local/lib/python2.5/site-packages/django/db/models/query.py",
line 313, in create
   obj.save(force_insert=True)

 File "/usr/local/lib/python2.5/site-packages/django/db/models/base.py",
line 307, in save
   self.save_base(force_insert=force_insert, force_update=force_update)

 File "/usr/local/lib/python2.5/site-packages/django/db/models/base.py",
line 379, in save_base
   result = manager._insert(values, return_id=update_pk)

 File "/usr/local/lib/python2.5/site-packages/django/db/models/manager.py",
line 138, in _insert
   return insert_query(self.model, values, **kwargs)

 File "/usr/local/lib/python2.5/site-packages/django/db/models/query.py",
line 888, in insert_query
   return query.execute_sql(return_id)

 File 
"/usr/local/lib/python2.5/site-packages/django/db/models/sql/subqueries.py",
line 308, in execute_sql
   cursor = super(InsertQuery, self).execute_sql(None)

 File "/usr/local/lib/python2.5/site-packages/django/db/models/sql/query.py",
line 1700, in execute_sql
   cursor.execute(sql, params)

 File "build/bdist.linux-x86_64/egg/MySQLdb/cursors.py", line 166, in execute
   self.errorhandler(self, exc, value)

 File "build/bdist.linux-x86_64/egg/MySQLdb/connections.py", line 35,
in defaulterrorhandler
   raise errorclass, errorvalue

OperationalError: (1213, 'Deadlock found when trying to get lock; try
restarting transaction')

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

Reply via email to