>> Definition of the problem:
>>
>> Parent Table --->   Child Table (has 2 children) -->   Grandchild 1&
>> Grandchild 2
>> setParams(), requery(), delete() --->   all work great from python shell
>> (&   from any IDE).
>>
>> When the same thing is run from within a web-framework (web2py),
>> following traceback is thrown.
>> I fail to know whether due to some conditions such as stateless nature
>> or whatever of any web framework, this behaviour is seen.
>>
>> I understand that this question is somewhat skew on this mailing list.
>> But still, if somebody can suggest any possibility, it would be a great
>> help to me.
>>
>> Traceback (most recent call last):
>> File "gluon/restricted.py", line 194, in restricted
>> File "F:/web2py/applications/payroll/controllers/empmast.py"
>> </admin/default/edit/payroll/controllers/empmast.py>, line 161, in<module>
>> File "gluon/globals.py", line 149, in<lambda>
>> File "F:/web2py/applications/payroll/controllers/empmast.py"
>> </admin/default/edit/payroll/controllers/empmast.py>, line 137, in emp_del
>> File "F:\web2py\site-packages\dabo\biz\dBizobj.py", line 1096, in requery
>> File "F:\web2py\site-packages\dabo\biz\dBizobj.py", line 1753, in
>> requeryAllChildren
>> File "F:\web2py\site-packages\dabo\biz\dBizobj.py", line 1076, in requery
>> File "F:\web2py\site-packages\dabo\biz\dBizobj.py", line 2594, in
>> _getDataStructure
>> File "F:\web2py\site-packages\dabo\db\dCursorMixin.py", line 2879, in
>> _getDataStructure
>> File "F:\web2py\site-packages\dabo\db\dBackend.py", line 502, in
>> getStructureDescription
>> File "F:\web2py\site-packages\dabo\db\dCursorMixin.py", line 384, in execute
>> DBQueryException: (0, '')
>>
>> Regards,
>>
>> Vineet
> I attempted to debug from within pyscripter IDE.
> While "child.requery()",
> in "MySQLdb\cursors.py",
> in "def execute()",
> at statement -->  "charset = db.character_set_name()"
> it throws above-mentioned error.
>
> That means, it is not able to get character set (it is Latin-1).
> *** But it works while requerying Parent bizobj.
>
> What additional debug lines I should put to find out the problem?
>
> Thanks,
> Vineet
> ------------------------------
> Message: 7
> Date: Wed, 26 Oct 2011 06:17:18 -0700
> From: Paul McNett<[email protected]>
> To: Dabo Users list<[email protected]>
> Subject: Re: [dabo-users] requery() - strange behaviour in web
>       environment
> Message-ID:<[email protected]>
> Content-Type: text/plain; charset=UTF-8; format=flowed
>
> On 10/25/11 10:51 PM, Vineet Deodhar wrote:
>>>>   Traceback (most recent call last):
>>>>   File "gluon/restricted.py", line 194, in restricted
>>>>   File "F:/web2py/applications/payroll/controllers/empmast.py"
>>>>   </admin/default/edit/payroll/controllers/empmast.py>, line 161, 
>>>> in<module>
>>>>   File "gluon/globals.py", line 149, in<lambda>
>>>>   File "F:/web2py/applications/payroll/controllers/empmast.py"
>>>>   </admin/default/edit/payroll/controllers/empmast.py>, line 137, in 
>>>> emp_del
>>>>   File "F:\web2py\site-packages\dabo\biz\dBizobj.py", line 1096, in requery
>>>>   File "F:\web2py\site-packages\dabo\biz\dBizobj.py", line 1753, in
>>>>   requeryAllChildren
>>>>   File "F:\web2py\site-packages\dabo\biz\dBizobj.py", line 1076, in requery
>>>>   File "F:\web2py\site-packages\dabo\biz\dBizobj.py", line 2594, in
>>>>   _getDataStructure
>>>>   File "F:\web2py\site-packages\dabo\db\dCursorMixin.py", line 2879, in
>>>>   _getDataStructure
>>>>   File "F:\web2py\site-packages\dabo\db\dBackend.py", line 502, in
>>>>   getStructureDescription
>>>>   File "F:\web2py\site-packages\dabo\db\dCursorMixin.py", line 384, in 
>>>> execute
>>>>   DBQueryException: (0, '')
>>>>
>>>>   Regards,
>>>>
>>>>   Vineet
>> I attempted to debug from within pyscripter IDE.
>> While "child.requery()",
>> in "MySQLdb\cursors.py",
>> in "def execute()",
>> at statement -->   "charset = db.character_set_name()"
>> it throws above-mentioned error.
>>
>> That means, it is not able to get character set (it is Latin-1).
>> *** But it works while requerying Parent bizobj.
>>
>> What additional debug lines I should put to find out the problem?
> One thing you should do right after your first 'import dabo' is
> 'dabo.eatBizExceptions = False'. This will keep the final raised exception 
> from being
> a dException object, giving you useful information for debugging what's 
> actually
> going on.
>
> My hunch is that web2py has its own virtualenv set, and you haven't properly 
> install
> MySQLdb inside that virtualenv.
>
> Paul
>


I inserted the following code before the requery() statement. (Actually 
it was for some other purpose).
[CODE]
ac_cursor = conn.cursor()
         acstring = "select acid from emp where empid=%s" % request.args[0]
         ac_cur.execute(acstring)
         ac_id = ac_cur.getDataSet()[0]['acid']
[/CODE]

And now the error in requery() is vanished.
=-O
I wonder what has happened under the hood of dabo.
I should not heave a sigh of relief, just because this stuff is working now.
If I know exactly what has happened, I can troubleshoot later for other 
code.

Any idea as to what might have happened there?

Regards,

Vineet
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[email protected]

Reply via email to