Where do you put the
- db._adapter.close()
- db._adapter.reconnect
In the Scheduler.py file?
For some reason I'm still getting the lost connection error. I'm putting the
close() and reconnect() in Scheduler.py and they surround the long processes.
--
Resources:
- http://web2py.com
- http://w
Thanks Paolo, the bit missing was being on the latest trunk. Much neater
than what I had as I don't need to reload the open records :)
Just to confirm the solution for anyone else who gets it:
db._adapter.close()
# call long running process
db._adapter.reconnect()
And it works exactly as I'd
Ian, as mentioned before, with the last trunk a reconnect can be done with
the following:
- db._adapter.close()
- db._adapter.reconnect()
Without the last trunk, try the following:
try:
db._adapter.close()
except:
db._adapter.connection = None
db._adapter.reconnect()
but my suggestion is
The issue sits with the parent method - it calls a method which takes > 300
seconds, then whatever action is taken with the database in the parent
method on return blows up.
I think I've cracked it though - and to get there I had to drop the web2py
scheduler and write my own so I knew what was
your query takes to much time to be executed and the query goes into
timeout.
>From the log I see that you are running a bulk_insert, you can split it
into more operations, placing a db.commit between them.
Mind that in this case the bulk_insert will be executed into few
transactions.
Otherwise, y
Thanks Paolo - sadly same result :( I'm not using pyDAL, just the usual
Web2py DAL
##
305
##
Traceback (most recent call last):
File "/home/ianryder/yarpr/web2py/gluon/restricted.py", line 224, in
restrict
Hi,
first of all use the latest pydal, it contains a fix when trying to close
'broken connection'.
Afterwards, for a proper reconnect in your application you should do:
- db._adapter.close()
- db._adapter.reconnect()
If you are looking for an 'auto-reconnect', namely it will re-execute all
queri
Sorry, formatting was all screwy on the last bit of the OP - 2 processing
running together, one lasting 295 seconds and saving without issue, the
other lasting 305 seconds and failing because the SQL server has gone /
isn't reconnected:
##
295#
8 matches
Mail list logo