I did some more testing and the problem still occures, not so frequently, 
but it does meaning the single json call didnt solve the issue. Now I am 
about to give it a try with MySQL, however I doubt it will help, because I 
put a comment as the first action in the mentioned controller and not even 
this action is performed, which leads me to opinion that web2py is doing 
something else while I try to access this controller. Can I somehow find 
out what it could be or what is the last action web2py performed?

Thank you, Jan

Dne úterý, 5. června 2012 10:05:24 UTC+2 mcm napsal(a):
>
> @Jan 
>
> Just a doubt.  There are two mutexes when using sqlite 
> - session opening (normal) 
> - db access (only with sqlite) 
>
>
>
> You should see what happens using another db (RDBMS like postgresql, 
> mysql). If that solves the problem, you found a bug. 
> Then post an issue on web2py.googlecode.com 
>
> mic 
>
>
> 2012/6/4 Jan Rozhon <[email protected]>: 
> > Yea, it is sqlite db. May it cause the trouble? Thanks Jan. 
> > 
> > Dne pondělí, 4. června 2012 21:53:20 UTC+2 mcm napsal(a): 
> >> 
> >> @Jan 
> >> 
> >> are you using sqlite? 
> >> 
> >> mic 
> >> 
> >> 
> >> 2012/6/4 Massimo Di Pierro <[email protected]>: 
> >> > I do not know what may be causing it, except that: 
> >> > 
> >> > - one ajax/json call is better than many 
> >> > - each call will lock the session for the use which means they are 
> not 
> >> > executed concurrently, they are queued, unless you 
> >> > session._unlock(response). 
> >> > 
> >> > 
> >> > 
> >> > On Monday, 4 June 2012 11:02:23 UTC-5, Jan Rozhon wrote: 
> >> >> 
> >> >> Hi Massimo, 
> >> >> 
> >> >> thank you for your answer. Unfortunately, it didnt help. One thing I 
> >> >> didn't mention and might be causing this trouble is, that I ask for 
> >> >> several 
> >> >> json values provided by similar controllers as I posted in my first 
> >> >> post. 
> >> >> Can the multitude ofjson requests cause this weird behaviour? In 
> other 
> >> >> words, is it better to provide several small json streams or one 
> large? 
> >> >> 
> >> >> Thanks in advance, Jan 
> >> >> 
> >> >> Dne pondělí, 4. června 2012 17:38:41 UTC+2 Massimo Di Pierro 
> napsal(a): 
> >> >>> 
> >> >>> Try replace output=rows with output=rows.as_list() 
> >> >>> Perhaps the rows are not json serializable. 
> >> >>> 
> >> >>> On Monday, 4 June 2012 02:20:39 UTC-5, Jan Rozhon wrote: 
> >> >>>> 
> >> >>>> Hi group, I have encountered a problem when I try to call a 
> >> >>>> controller 
> >> >>>> which should return a JSON array of values from database. However 
> in 
> >> >>>> abou 1 
> >> >>>> of 5 cases this call stucks in "loading" phase (chrome animation 
> in 
> >> >>>> tab) and 
> >> >>>> no response is received. Data is in database, every other 
> controller 
> >> >>>> is 
> >> >>>> working fine, cpu utilization is pretty low so is the memory and 
> >> >>>> there are 
> >> >>>> only about 10000 rows in DB. Could you please give me some hints? 
> >> >>>> 
> >> >>>> Thanks, Jan 
> >> >>>> 
> >> >>>> PS. The controller looks like this: 
> >> >>>> 
> >> >>>> def dberrorsselect(): 
> >> >>>>     """Performs sql query to get the errors in the form of list of 
> >> >>>> dicts 
> >> >>>> such as {field_name:value}. This is then transformed to json dict 
> for 
> >> >>>> transfer.""" 
> >> >>>>     if session.tb_id: 
> >> >>>> 
> >> >>>> 
> >> >>>> 
> max_id=tb(tb.errors.test_id==session.tb_id).select(tb.errors.id.max()).first()[tb.errors.id.max()]
>  
>
> >> >>>>         if max_id != None: 
> >> >>>>             selector_id=int(max_id)-5 
> >> >>>>         else: 
> >> >>>>             selector_id=0 
> >> >>>>         rows=tb((tb.errors.test_id==session.tb_id)&(tb.errors.id> 
> >> >>>> selector_id)).select(tb.errors.ts, tb.errors.msg_short, 
> >> >>>> tb.errors.msg_long) 
> >> >>>>         output=rows 
> >> >>>>     else: 
> >> >>>>         output=[] 
> >> >>>>     return dict(output=output) 
> >> >>>> 
> >> >>>> 
> >> > 
>

Reply via email to