-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi there SQLObject gurus.
I've come across a somewhat annoying problem with SQLObject. At least I
think the problem is with SQLObject.
My system:
Turbogears 0.9a2
with
SQLObject 0.8dev-r1672
running under
Apache/2.0.55 (Unix)
with:
mod_pubcookie/3.3.0a
mod_python/3.2.8
Python/2.4.2
DAV/2
mod_ssl/2.0.55
OpenSSL/0.9.8
On solaris 8 on an ultraSPARC II based machine.
SQLObject connects to postgresql 8.1.3, running on a linux (suse I
think, maybe redhat) opteron machine.
#------------------------------------------------------------------
The trouble I am having is that SQLObject seems to be losing it's
connection to the database after a few days of inactivity.
The website I'm working on will function correctly throughout all of
friday, and still be working before I leave, but when I arrive on monday
morning, i get the following traceback (with my annotations):
#------------------------------------------------------------------
19/Apr/2006:14:40:24 HTTP INFO Page handler: <bound method Root.default
of <paradisec3.controllers.Root object at 0xc34d90>>
Traceback (most recent call last):
File
"/opt/python-2.4.2b/lib/python2.4/site-packages/CherryPy-2.2.0rc1-py2.4.egg/cherrypy/_cphttptools.py",
line 99, in _run
self.main()
File
"/opt/python-2.4.2b/lib/python2.4/site-packages/CherryPy-2.2.0rc1-py2.4.egg/cherrypy/_cphttptools.py",
line 248, in main
body = page_handler(*virtual_path, **self.params)
File "<string>", line 3, in default
File
"/opt/python-2.4.2b/lib/python2.4/site-packages/TurboGears-0.9a2-py2.4.egg/turbogears/controllers.py",
line 207, in expose
output = database.run_with_transaction(expose._expose,func, accept,
allow_json, allow_json_from_config,*args, **kw)
File
"/opt/python-2.4.2b/lib/python2.4/site-packages/TurboGears-0.9a2-py2.4.egg/turbogears/database.py",
line 216, in run_with_transaction
retval = func(*args, **kw)
File "<string>", line 5, in _expose
File
"/opt/python-2.4.2b/lib/python2.4/site-packages/TurboGears-0.9a2-py2.4.egg/turbogears/controllers.py",
line 228, in <lambda>
expose._expose.when(rule)(lambda _func, accept, allow_json,
allow_json_from_config,*args,**kw: _execute_func(
File
"/opt/python-2.4.2b/lib/python2.4/site-packages/TurboGears-0.9a2-py2.4.egg/turbogears/controllers.py",
line 246, in _execute_func
output = errorhandling.try_call(func, *args, **kw)
File
"/opt/python-2.4.2b/lib/python2.4/site-packages/TurboGears-0.9a2-py2.4.egg/turbogears/errorhandling.py",
line 59, in try_call
output = func(self, *args, **kw)
File
### Here follows my call into the SQLObject class
"/projects/f48/releases/website/current/paradisec3/paradisec3/controllers.py",
line 43, in default
self.rights = [ right for right in
currentRights.selectBy(username=self.remote_user) ]
File
"/opt/python-2.4.2b/lib/python2.4/site-packages/SQLObject-0.8dev_r1672-py2.4.egg/sqlobject/sresults.py",
line 156, in __iter__
return iter(list(self.lazyIter()))
File
"/opt/python-2.4.2b/lib/python2.4/site-packages/SQLObject-0.8dev_r1672-py2.4.egg/sqlobject/sresults.py",
line 164, in lazyIter
return conn.iterSelect(self)
File
"/opt/python-2.4.2b/lib/python2.4/site-packages/SQLObject-0.8dev_r1672-py2.4.egg/sqlobject/dbconnection.py",
line 822, in iterSelect
select, keepConnection=True)))
File
"/opt/python-2.4.2b/lib/python2.4/site-packages/SQLObject-0.8dev_r1672-py2.4.egg/sqlobject/dbconnection.py",
line 753, in __init__
self.dbconn._executeRetry(self.rawconn, self.cursor, self.query)
File
"/opt/python-2.4.2b/lib/python2.4/site-packages/SQLObject-0.8dev_r1672-py2.4.egg/sqlobject/dbconnection.py",
line 306, in _executeRetry
return cursor.execute(query)
OperationalError: no connection to the server
#------------------------------------------------------------------
So the problem seems to be coming from SQLObject
Restarting apache fixes the problem and the website works again until
some time later, I haven't been able to find out the exact timings of
when it starts dying., but it's between 3 days and 24 hours.
should I be wrapping my call with a try/except? and what should I do in
the case that I get that error anyway? is there a way to reconnect??
I'm hoping someone can help us with this, as we need to be going into
production fairly soon! But with this problem it really isn't feasible.
I am subscribed to this list (sqlobject-discuss).
Thankyou for your time.
- --
Paul Warren
ANU Supercomputer Facility
Leonard Huxley Building.
u3292467 at anu dot edu dot au
pwarren.homelinux.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFERcFqbf5/PcytO2ERAkjYAJwOkmFBL+aWXIkTVzefL1sMivsjKACgkS5A
LyaxNqa7hdUvPYlcRmCRkJc=
=zv4g
-----END PGP SIGNATURE-----
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss