Hello,

I have a low volume application running on a shared host. All seems ok 
except I am getting a lot - 260 in a week - of OperationalError's like this:

Traceback (most recent call last):
  File "/home/tgaa/web2py/gluon/main.py", line 543, in wsgibase
    BaseAdapter.close_all_instances('rollback')
  File "/home/tgaa/web2py/gluon/dal.py", line 599, in close_all_instances
    db._adapter.close(action)
  File "/home/tgaa/web2py/gluon/dal.py", line 579, in close
    getattr(self, action)()
  File "/home/tgaa/web2py/gluon/dal.py", line 1872, in rollback
    return self.connection.rollback()
OperationalError: (2006, 'MySQL server has gone away')

I'm using the default pymysql with a connection pool of 0, because when I 
ran with a connection pool of 5 I was getting hundreds of these errors per 
day. I thought with a connection pool of 0, web2py would attempt to make a 
new connection each time. I know that the ISP has set the wait_timeout 
value in MySQL to 45 seconds, but I am getting the ticket much more quickly 
than that.

I have tried to wrap my DB call in a try: except: OperationalError block to 
at least try to catch the error and put out something sensible when the 
database isn't there, but that doesn't work.

My questions are:
- how do I investigate why web2py is losing its database connection
- what can I do when that happens to protect the user from the error ticket.

Thanks for any assistance.


-- 
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to