Thanks for ur reply Micheal.
It is hanging exactly on following line:

rs = InqueuePing.objects.filter(processed = 0).order_by('-timestamp')

If I remove order_by function then it works fine.

I think this is not django issue. I debug the code using pdb and found
that the code is hanging from MySQLdb library. Please consider
following line from cursors.py:

def _get_result(self): return self._get_db().store_result()

its line number is 314. Code get hanged on store_result(). I try to
step in to this function but pdb is not going further deep. I think it
may be some kind of mysql server configuration issue or mysql server
bug or MySQLdb library issue. Do u any thing regarding this scenario?

On Sep 29, 2:06 am, Michael <newmani...@gmail.com> wrote:
> On Mon, Sep 28, 2009 at 2:38 AM, Waqas <badar.wa...@gmail.com> wrote:
>
> > I have written an offline application. In this application, i have
> > written following code:
>
> > rs = InqueuePing.objects.filter(processed = 0).order_by('-timestamp')
>
> > if rs:
> >    #bla bla bla here
>
> > The process is hanging on evaluating the if condition. I digg the code
> > of django and i found that django framework is getting hang in django/
> > db/models/query.py in method _fill_cache(self, num=None). I found that
> > nothing is happening  after the following line in _fill_cache(self,
> > num=None) method:
>
> > self._result_cache.append(self._iter.next())
>
> > I found self._iter.next() is causing the issue. Any body else has face
> > this problem or not. Can any body please tell me which function
> > self._iter is pointing?
>
> This is interesting and I have never seen this kind of issue. I am curious
> to see if it only does it for this query or if it would for:
> rs = InqueuePing.objects.filter(processed=0)
>
> or
>
> rs = InqueuePing.objects.order_by('-timestamp')
>
> In my years of python programming, I have never seen python 'hang'. it
> always is working on something. I would like to figure out what that
> something is.
>
> Before digging into Django's source code, can we get this down to a simplest
> case. Can you create a fixture of the database? Can you create the lines
> that hang? I would like to see if it might be a db configuration issue, your
> code issue or a Django issue.
>
> Thanks,
>
> Michael
--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to