#781: SQLObject does not reconnect
-----------------------+----------------------------------------------------
Reporter: ghaering | Owner: anonymous
Type: defect | Status: new
Priority: normal | Milestone:
Component: SQLObject | Version: 0.9a4
Severity: critical | Resolution:
Keywords: |
-----------------------+----------------------------------------------------
Comment (by Baruch <[EMAIL PROTECTED]>):
In my case the exception happens in the identity module, after that the
cherrypy.request object is lost and the whole TurboGears app is hosed.
An exception in the identity part:
{{{
Page handler: 'MySQL server has gone away'
Traceback (most recent call last):
File "/usr/lib/python2.4/site-
packages/CherryPy-2.2.0-py2.4.egg/cherrypy/_cphttptools.py", line 104, in
_run
applyFilters('before_main')
File "/usr/lib/python2.4/site-
packages/CherryPy-2.2.0-py2.4.egg/cherrypy/filters/__init__.py", line 151,
in applyFilters
method()
File "/usr/lib/python2.4/site-packages/TurboGears-0.9a3-
py2.4.egg/turbogears/visit.py", line 149, in before_main
visit= _manager.visit_for_key( visit_key )
File "/usr/lib/python2.4/site-packages/TurboGears-0.9a3-
py2.4.egg/turbogears/visit.py", line 304, in visit_for_key
visit= TG_Visit.lookup_visit( visit_key )
File "/usr/lib/python2.4/site-packages/TurboGears-0.9a3-
py2.4.egg/turbogears/visit.py", line 340, in lookup_visit
return cls.by_visit_key( visit_key )
File "<string>", line 1, in <lambda>
File "/usr/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1675-
py2.4.egg/sqlobject/main.py", line 1266, in _SO_fetchAlternateID
result, obj = cls._findAlternateID(name, dbName, value, connection)
File "/usr/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1675-
py2.4.egg/sqlobject/main.py", line 1262, in _findAlternateID
value), None
File "/usr/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1675-
py2.4.egg/sqlobject/dbconnection.py", line 587, in _SO_selectOneAlt
return self.queryOne("SELECT %s FROM %s WHERE %s = %s" %
File "/usr/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1675-
py2.4.egg/sqlobject/dbconnection.py", line 755, in queryOne
return self._dbConnection._queryOne(self._connection, s)
File "/usr/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1675-
py2.4.egg/sqlobject/dbconnection.py", line 341, in _queryOne
self._executeRetry(conn, c, s)
File "/usr/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1675-
py2.4.egg/sqlobject/mysql/mysqlconnection.py", line 60, in _executeRetry
return cursor.execute(query)
File "/usr/lib/python2.4/site-packages/MySQLdb/cursors.py", line 137, in
execute
self.errorhandler(self, exc, value)
File "/usr/lib/python2.4/site-packages/MySQLdb/connections.py", line 33,
in defaulterrorhandler
raise errorclass, errorvalue
OperationalError: 2006
}}}
And the exception later in the request object:
{{{
Traceback (most recent call last):
File "/usr/lib/python2.4/site-
packages/CherryPy-2.2.0-py2.4.egg/cherrypy/_cpwsgi.py", line 75, in
wsgiApp
environ['wsgi.input'])
File "/usr/lib/python2.4/site-
packages/CherryPy-2.2.0-py2.4.egg/cherrypy/_cphttptools.py", line 79, in
run
_cputil.get_special_attribute("_cp_log_access", "_cpLogAccess")()
File "/home/myproj/apps/myproj/webapp/myproj/controllers.py", line 476,
in _cp_log_access
s = tmpl % {'h': cherrypy.request.remoteHost,
File "/usr/lib/python2.4/site-
packages/CherryPy-2.2.0-py2.4.egg/cherrypy/__init__.py", line 43, in
__getattr__
return getattr(childobject, name)
AttributeError: 'Request' object has no attribute 'identity'
}}}
--
Ticket URL: <http://trac.turbogears.org/turbogears/ticket/781>
TurboGears <http://www.turbogears.org/>
TurboGears front-to-back web development
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears Tickets" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears-tickets
-~----------~----~----~----~------~----~------~--~---