Actually, I found the problem and it WAS in my code, only Kid made it 200 times more difficult to track down the problem. See my most recent message in the "SQLObject transaction problems" thread.

I agree that debugging TurboGears applications is nightmarish at the moment. I can only hope that's going to improve. At least when I was doing JSPs, I had some prayer of knowing what line the error appeared on.

On 7 Jan, 2006, at 7:31 pm, Cliff Wells wrote:

Well, I think the real issue is that there are too many layers of abstraction and the real problem is getting obscured, hence my comment about finding raw SQL tempting.  One of the reasons I've resisted frameworks in the past is due to things like this.  When things work they are great, when they don't, debugging can be a nightmare.  In this case, the problem seems to stem from the fact that an exception occurred at some point, but database.py continues to try to clean up before letting the exception bubble up which in turn causes a different exception to get thrown and the original problem is lost.  I think that unless there's a good reason, I'd remove the rollback_all() from within the except block in run_with_transaction() as I suspect that to be the culprit, or perhaps just have it print the traceback *before* it tries to do anything else. 

import sys, traceback
def run_with_transaction(func, *args, **kw):
   try:
       try:
           retval = func(*args, **kw)
           commit_all()
           return retval
       except cherrypy.HTTPRedirect:
           commit_all()
           raise
       except cherrypy.InternalRedirect:
           commit_all()
           raise
       except:
           traceback.print_exc(file=sys.stdout)
           rollback_all()
           raise
   finally:
       end_all()





Regards,
Cliff


--

Jeff Watkins



'I know about people who talk about suffering for the common good. It's never bloody them! When you hear a man shouting "Forward, brave comrades!" you'll see he's the one behind the bloody big rock and the one wearing the only really arrow-proof helmet!'

-- Rincewind gives a speech on politics. (Terry Pratchett, _Interesting Times_)





--

Jeff Watkins

http://newburyportion.com/


'I know about people who talk about suffering for the common good. It's never bloody them! When you hear a man shouting "Forward, brave comrades!" you'll see he's the one behind the bloody big rock and the one wearing the only really arrow-proof helmet!'

-- Rincewind gives a speech on politics. (Terry Pratchett, Interesting Times)



Reply via email to