Hi Anthony,
      Yes there are many queries that are being fired - Since it is a 
dashboard I have multiple queries being fired sequentially/simultaneously. 
I have a number of those queries in try catch block as well. I certainly 
agree that rolling back is not a good solution and in-fact I am in process 
of getting rid of all try -catch block queries with proper DAL supported 
queries. I also had quite a few *db.executesql (...)* statements which I am 
replacing with appropriate DAL queries for maximum compatibility.  I would 
share the queries with you once my cleanup is done and if even after that  
by removing *db.rollback()* they still throw errors. Since the code is 
scattered in multiple functions, it is taking time for me to fix it. 

Application in brief - The application I've written is huge with 26 
different modules (Dashboard being one of them). All other modules are 
working fine except Dashboard which serves the users to view different 
statistics, drill down in charts, with all  sort of notifications, alerts 
etc  (eight sections in all), There are settings centrally for each section 
to control its visibility. This is the reason for multiple queries that 
provide data for viewing, analysis and updates are carried out separately 
when required. 

Thanks,
Rahul 

-------------


On Wednesday, August 1, 2018 at 8:59:27 PM UTC+5:30, Anthony wrote:
>
> On Wednesday, August 1, 2018 at 8:48:54 AM UTC-4, Rahul wrote:
>>
>> Hi Anthony,
>>         I used *db.rollback**()* and viola - A lot of my failing stuff 
>> started to work.  I am rectifying the failing queries and still trying to 
>> figure out the incorrect SQL statement that is causing the error. For below 
>> question - Again if I print db.rollback() a *None* is returned.
>> What happens if you call db.rollback() right before running these queries 
>> that are generating the error?
>> I still want to know what all does - 
>> db.rollback() function what does it do exactly ? rollback previously 
>> executed queries? It is working like a charm.
>>
>
> This is not the ideal solution because you may be rolling back good 
> queries that you would otherwise want to commit. You should try to identify 
> what queries are causing problems. Do you have any queries in a try/except 
> that could be causing (uncaught) errors? What other queries are running 
> before you get to the queries you have shown?
>
> Anthony
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.

Reply via email to