This isn't something that happens regularly. This error has only come
about once as far as I can tell. It just isn't properly handled and I
wondered what other folks did. Ideally we would have something like
you described that retrys the writes but it occurs infrequenly enough
that I think we can just catch it and return an error to the user.

I'm curious what you did to catch the error and retry. Did you create
a custom kind of DB backend? or did you just add that logic to the
particular view that was giving you trouble?

Ian

On Wed, Nov 19, 2008 at 1:40 PM, DavidA <[EMAIL PROTECTED]> wrote:
>
> Unrelated to Django, but we occasionally get deadlocks in MySQL due to
> separate tasks running at the same time and accessing some tables in
> common. We recently added logic to catch the exception, wait a second
> or two, and retry it a few times before we give up. Most of the time,
> that fixes it.
>
> I agree with Malcolm, though, that for a pure Django app, I would
> think it fairly unlikely to occur unless you are doing something non-
> standard with your models/logic.
>
> -Dave
>
> On Nov 18, 8:52 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
> wrote:
>> On Wed, 2008-11-19 at 10:21 +0900, Ian Lewis wrote:
>> > 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?
>>
>> That sounds reasonable.
>>
>> More substantive for our purposes, though, would be knowing why this
>> occurred and if there was any way to avoid it. Either you have a fairly
>> twisted model setup that means an insert causes a deadlock, or there's
>> something that can be improved in Django. So if you could post some
>> details of how you are able to cause this error, it would be appreciated
>> (by me, at least).
>>
>> Regards,
>> Malcolm
> >
>

--~--~---------~--~----~------------~-------~--~----~
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