--- Geoffrey Talvola <[EMAIL PROTECTED]> wrote:
> Karl Putland wrote:
> > I'm trying to understand the whole transaction mechanism in
[...]
>
> Maybe the right thing to do is to modify WebKit so that if an
> exception
> occurs during respond(), it still calls sleep() afterwards. The
> idea is
> that if awake() succeeds, then we should always call sleep() to
> clean up
> regardless of what happened in respond().
>
> Thoughts?
I agree that sleep() should definetely be called if awake()
succeeds in order to attempt to clean up any resources that the
Page/Servlet might have allocated.
>
> The other place you could put a cleanup hook without any mods to
> Webware
> would be in a replacement for _respond(). You could write:
>
> def _respond(self):
> try:
> Page._respond(self)
> except:
> self.rollbackTransaction()
> else:
> self.commitTransaction()
>
> This wouldn't catch errors that happen _during_ the awake() call.
> But maybe
> that's OK.
Thanks for the idea. For now I guess that's what I'll do. Although
in execpt, it should probably also call call raise to allow the
exception to percolate up to the ErrorHandler.
...
except:
self.rollbackTransaction()
raise
else:
...
--Karl
__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss