Have you removed the db statements inside try....except...? That's the 
cause of the problem. if a db command fails, the db may close connection 
and your driver raises an exception. Your code catches
the exception and pretends to continue execution but the database is 
telling you the connection was closed. You cannot pretent nothing happened.

Massimo
 
On Saturday, 23 February 2013 09:35:55 UTC-6, __pyslan__ wrote:
>
> Hello everybody,
>
> I have not found a solution yet ...
> Does anyone have any idea how I could do?
>
>
>
> Thanks...
>
>
>
> On Fri, Feb 22, 2013 at 9:33 AM, __pyslan__ - Ayslan Jenken <
> ayslan...@gmail.com <javascript:>> wrote:
>
>> Well... 
>>
>> Sorry, but the information about the code comment is wrong...
>>
>> I uncomment the code block "if db(db.auth_user).isempty():" and the error 
>> not thrown. 
>>
>> With or without the code block above, in the terminal server is shown the 
>> error:
>>
>> DEBUG: connect attempt 0, connection error:
>>
>> Traceback (most recent call last):
>>   File "/home/ctx/PROJECTS/WEB/web2py/gluon/dal.py", line 6853, in 
>> __init__
>>     self._adapter = ADAPTERS[self._dbname](**kwargs)
>>   File "/home/ctx/PROJECTS/WEB/web2py/gluon/dal.py", line 2402, in 
>> __init__
>>     if do_connect: self.reconnect()
>>   File "/home/ctx/PROJECTS/WEB/web2py/gluon/dal.py", line 588, in 
>> reconnect
>>     self.cursor = cursor and self.connection.cursor()
>> AttributeError: 'NoneType' object has no attribute 'cursor'
>>
>>
>>
>>
>> On Fri, Feb 22, 2013 at 9:12 AM, __pyslan__ - Ayslan Jenken <
>> ayslan...@gmail.com <javascript:>> wrote:
>>
>>> Hello, Massimo.
>>>
>>> With this change is launched this error:
>>>
>>> Traceback (most recent call last):
>>>    File "/ home/ctx/PROJECTS/WEB/web2py/gluon/main.py", line 632, in 
>>> wsgibase
>>>      BaseAdapter.close_all_instances ('rollback')
>>>    File "/ home/ctx/PROJECTS/WEB/web2py/gluon/dal.py", line 543, in 
>>> close_all_instances
>>>      db._adapter.close (action)
>>>    File "/ home/ctx/PROJECTS/WEB/web2py/gluon/dal.py", line 523, in 
>>> close
>>>      getattr (self, action) ()
>>>    File "/ home/ctx/PROJECTS/WEB/web2py/gluon/dal.py", line 1670, in 
>>> rollback
>>>      if self.connection: return self.connection.rollback ()
>>> ProgrammingError: (2014, "Commands out of sync, you can not run this 
>>> command now")
>>>
>>>
>>> When this error occurs, I have to wait a while to access any other page, 
>>> even 
>>> the ticket, because it generates new tickets. 
>>> This error is also thrown when I try to quickly update any other page 
>>> repeatedly. This error no longer occurs only when I comment the code:
>>> if db (db.auth_user). isempty ()
>>>
>>> But still happening with the execution of the stored procedure.
>>>
>>> Thanks...
>>>
>>>
>>> On Fri, Feb 22, 2013 at 12:22 AM, Massimo Di Pierro <
>>> massimo....@gmail.com <javascript:>> wrote:
>>>
>>>> Does it work if you replace
>>>>
>>>> db(db.auth_user).isempty():
>>>>
>>>> with 
>>>>
>>>> len(db(db.auth_user).select(limitby=(0,1)))
>>>> *
>>>> *
>>>> *This is not a solution but can help me understand.
>>>> *
>>>>
>>>> On Thursday, 21 February 2013 14:07:25 UTC-6, __pyslan__ wrote:
>>>>
>>>>> Sorry...
>>>>>
>>>>> The error occur on line 3 of this file:
>>>>>
>>>>> https://gist.github.com/**pyslan/5007722<https://gist.github.com/pyslan/5007722>
>>>>>  
>>>>>
>>>>> On Thu, Feb 21, 2013 at 4:45 PM, __pyslan__ - Ayslan Jenken <
>>>>> ayslan...@gmail.com> wrote:
>>>>>
>>>>>> Hello, Erevybody!
>>>>>>
>>>>>> I am using MySQL on a project and created two procedures to perform a 
>>>>>> recursion, because users have users parents.
>>>>>>
>>>>>> The extra fields in the users table:
>>>>>> https://gist.github.com/**pyslan/5007384<https://gist.github.com/pyslan/5007384>
>>>>>>
>>>>>>
>>>>>> Performing some research and testing, I came to the code as follows:
>>>>>> https://gist.github.com/**pyslan/5007364<https://gist.github.com/pyslan/5007364>
>>>>>>
>>>>>> And the stored procedures [1]:
>>>>>>
>>>>>> https://gist.github.com/**pyslan/5007439<https://gist.github.com/pyslan/5007439>
>>>>>>
>>>>>> https://gist.github.com/**pyslan/5007414<https://gist.github.com/pyslan/5007414>
>>>>>>
>>>>>>
>>>>>>
>>>>>> Running the first time the page is created normally and shows the 
>>>>>> page with the data correctly. If I refresh the page, generates the 
>>>>>> following error:
>>>>>> <type'exceptions.TypeError'> 'NoneType' object is not iterable
>>>>>> If I upgrade again, again shows the correct page, and so on.
>>>>>>
>>>>>> I tried with migrate = False, and the behavior continues.
>>>>>>
>>>>>>
>>>>>> Does anyone have any idea what is causing this error, or a correct 
>>>>>> way of doing this using web2py and stored procedures with MySQL?
>>>>>>
>>>>>>
>>>>>> Thanks, guys!
>>>>>> [1] - Procedures adapted from that site: http://goo.gl/l6Nc2
>>>>>>  
>>>>>
>>>>>  -- 
>>>>  
>>>> --- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "web2py-users" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to web2py+un...@googlegroups.com <javascript:>.
>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>  
>>>>  
>>>>
>>>
>>>
>>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to