Reminder: Don't forget about this callback in page that you can use:
        def writeExceptionReport(self, handler):

See more below.


On Wednesday 03 April 2002 06:55 am, Geoffrey Talvola wrote:
> Seems like a good idea to move the full awake/respond/sleep cycle
> into Servlet to me.  But there could be some good reason why it is
> done in Application that I can't think of.
>
> Chuck?  Jay?
>
> - Geoff

On Wednesday 03 April 2002 08:22 am, Love, Jay wrote:
> This cycle has been in there since the beginning, and I suspect Chuck
> picked it up from Webobjects or somewhere like that.  I'll let him
> present his reasoons behind having the cycle and it's placement.

In order to allow the same kind of hooks that Servlet enjoys, awake and 
sleep are provided for app, request (?), response (?), session and 
transaction. This was a design I just borrowed from Apple's WebObjects 
as Jay pointed out somewhere.

As far as placement goes, it was simple to do it from Application and 
as Jay points out, easy to arrange for logging and managment.

The deal is that all the awake()s are called before all the responds() 
which are called before all the sleeps() (which I think are called in 
reverse order).

We can review our apps and if it looks like awake & sleep are not 
useful for these other objects, then we can cut them out. Then if they 
are only used for servlet, we could consider a run() method.

Or we could leave them and provide an enhancement to Page, as Geoff 
alluded to.


On Wednesday 03 April 2002 08:13 am, Karl Putland wrote:
> Seems to me that the application calls awake on the transaction,
> then the transaction calls awake on the session and the servlet.
> I don't have a problem with this, just that if awake succeeds, then
> sleep should be called.
>
> --Karl

What if awake() is partially successful? e.g., half its code executes 
but then raises an exception.

If sleep() is not called, some cached data/connections/whatever might 
never be invoked. If it is called, it might raise an exception because 
awake() didn't finish.

One answer might be to make sleep() robust in the face of partially 
executed awakes().


In this entire thread (which I think I've read), I haven't seen any 
reference to the fairly new:

        def writeExceptionReport(self, handler):

Which is a callback that should always take place regardless of where 
your exception was invoked (although we might want to double check 
that).

You should call super so the exception report looks right. You can then 
take whatever action you like:

        if hasattr(self, 'connection'):
                del self.connection


-Chuck

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

Reply via email to