Karl Putland wrote:
> I'm trying to understand the whole transaction mechanism in WebKit.
> 
> I attempted to subclass page calling it DatabasePage with methods
> for connection management and hook a hook around sleep to manage
> the commit/rollback for the page.  This works well for pages
> without errors. The commit is called for the conenction that was
> used on the page.  The problem occurrs if an error is introduced. 
> The awake respond sleep cycle is broken and my rollback never gets
> called.
> 
> Where would be the right place to hook into the transaction to
> support automatic commit/rollback?

I don't think you're going to get this to work using WebKit's current
awake/respond/sleep cycle, because as you noted, an exception anywhere ends
the whole sequence.

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?

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.

- Geoff

_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to