Here's _execute_func from controllers.py:
def _execute_func(self, func, tg_format,
html, *args, **kw):
output = func(self, *args, **kw)
if html and html.startswith("."):
html = func.__module__[:func.__module__.rfind('.')]+html
return _process_output(tg_format, output, html)
The database transaction is wrapped around this, and your exception is
appearing in the _process_output call at the end of this. What we can
deduce from this is:
1) your controller method (func, above) didn't raise an exception
2) that means that TurboGears' transaction wrapper wasn't responsible
for rolling back the transaction
3) the only code in TurboGears itself that does a rollback is the
stuff in database.py.
So, if *you're* not doing a rollback, that would imply that this
transaction is somehow being reused from somewhere else that *did*
cause a rollback. The transaction didn't go away from a previous
request, possibly? A filter gone awry? (TurboGears comes with a filter
now that attempts to end the transaction at the very end of the
cycle.)
Kevin
On 1/3/06, Jeff Watkins <[EMAIL PROTECTED]> wrote:
>
> The following is the complete exception stack trace starting with the
> ROLLBACK command someone is issuing to SQLObject. Just a note, I
> don't issue a rollback, so I assume an exception must have been
> thrown and this is crashing during the rollback. Only, I don't see
> any log of the exception.
>
> 1/ROLLBACK:
> 2006/01/03 21:38:09 INFO Traceback (most recent call last):
> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
> python2.4/site-packages/CherryPy-2.1.0-py2.4.egg/cherrypy/
> _cphttptools.py", line 271, in run
> main()
> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
> python2.4/site-packages/CherryPy-2.1.0-py2.4.egg/cherrypy/
> _cphttptools.py", line 502, in main
> body = page_handler(*args, **cherrypy.request.paramMap)
> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
> python2.4/site-packages/CherryPy-2.1.0-py2.4.egg/cherrypy/lib/
> cptools.py", line 122, in default
> return getattr(self, args[0])(*args[1:], **kwargs)
> File "/Users/jeff/Projects/Web/turbogears/turbogears/
> controllers.py", line 242, in newfunc
> html, *args, **kw)
> File "/Users/jeff/Projects/Web/turbogears/turbogears/database.py",
> line 189, in run_with_transaction
> retval = func(*args, **kw)
> File "/Users/jeff/Projects/Web/turbogears/turbogears/
> controllers.py", line 262, in _execute_func
> return _process_output(tg_format, output, html)
> File "/Users/jeff/Projects/Web/turbogears/turbogears/
> controllers.py", line 64, in _process_output
> output = view.render(output, tg_format, template=template)
> File "/Users/jeff/Projects/Web/turbogears/turbogears/view.py",
> line 62, in render
> return engine.render(info, format, fragment, template)
> File "/Users/jeff/Projects/Web/turbogears/turbogears/
> kidsupport.py", line 141, in render
> return t.serialize(encoding=self.defaultencoding, output=format,
> fragment=fragment)
> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
> python2.4/site-packages/kid-0.8-py2.4.egg/kid/__init__.py", line 232,
> in serialize
> return serializer.serialize(self, encoding, fragment)
> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
> python2.4/site-packages/kid-0.8-py2.4.egg/kid/serialization.py", line
> 51, in serialize
> text = list(self.generate(stream, encoding, fragment))
> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
> python2.4/site-packages/kid-0.8-py2.4.egg/kid/serialization.py", line
> 149, in generate
> for ev, item in self.apply_filters(stream):
> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
> python2.4/site-packages/kid-0.8-py2.4.egg/kid/serialization.py", line
> 77, in balancing_filter
> for ev, item in stream:
> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
> python2.4/site-packages/kid-0.8-py2.4.egg/kid/pull.py", line 203, in
> _coalesce
> for ev, item in stream:
> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
> python2.4/site-packages/kid-0.8-py2.4.egg/kid/filter.py", line 21, in
> transform_filter
> for ev, item in apply_matches(stream, template, templates,
> apply_func):
> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
> python2.4/site-packages/kid-0.8-py2.4.egg/kid/filter.py", line 31, in
> apply_matches
> item = stream.expand()
> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
> python2.4/site-packages/kid-0.8-py2.4.egg/kid/pull.py", line 95, in
> expand
> for ev, item in self._iter:
> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
> python2.4/site-packages/kid-0.8-py2.4.egg/kid/pull.py", line 164, in
> _track
> for p in stream:
> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
> python2.4/site-packages/kid-0.8-py2.4.egg/kid/pull.py", line 203, in
> _coalesce
> for ev, item in stream:
> File "/Users/jeff/Sites/turbo/shop/shop/templates/category.py",
> line 282, in _pull
> File "/Users/jeff/Sites/turbo/shop/shop/templates/master.py", line
> 235, in product_table
> File "<string>", line 1, in <lambda>
> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
> python2.4/site-packages/SQLObject-0.7.0-py2.4.egg/sqlobject/main.py",
> line 971, in _SO_loadValue
> selectResults = self._connection._SO_selectOne(self, dbNames)
> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
> python2.4/site-packages/SQLObject-0.7.0-py2.4.egg/sqlobject/
> dbconnection.py", line 787, in __getattr__
> self.assertActive()
> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
> python2.4/site-packages/SQLObject-0.7.0-py2.4.egg/sqlobject/
> dbconnection.py", line 728, in assertActive
> assert not self._obsolete, "This transaction has already gone
> through ROLLBACK; begin another transaction"
> AssertionError: This transaction has already gone through ROLLBACK;
> begin another transaction
>
>
--
Kevin Dangoor
Author of the Zesty News RSS newsreader
email: [EMAIL PROTECTED]
company: http://www.BlazingThings.com
blog: http://www.BlueSkyOnMars.com