Amit
unread,Jul 20, 2012, 2:52:51 AM7/20/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to web...@googlegroups.com
hi,
I have to implement one scenario where scheduler will make the query to database periodically to retrieve data(lets say every 10 mins), i have written function inside model db.py to retrieve the data, and from controller i am staring the scheduler and assign the job to get the data periodically.
Problem:
when i request the function of controller where i am starting scheduler from web browser , its executing perfectly and display the data first time , after that it started throwing error "ProgrammingError: Cannot operate on a closed database." continuously and i found that for each request models are executed DAL(...) statement and when action is done it will commit and rollback the db connection so because of that when scheduler tries to retrieve data second time from database using db , its throwing above mentioned error.
Note: I am using sqlite databse and APScheduler..
How to implement this scenario where request come very first time i need to start scheduler and assign the job so periodically it should query to db and retrieve the data(second time onwards to db instance should be alive) ?