Randall Randall wrote:

Trying to track down db transaction problems, it occurred to
me that I use the forward() method in Application quite a lot,
following the practice demonstrated in Examples/SecurePage.py .

I've been assuming that awake() is called again for the new
servlet, and that sleep() is called by forward previous to
this. Is this not the case? That is, it does appear that
awake() is called again; I had to add code to handle the case
of things being initialized twice in my SitePage for a single
request. I'm less sure, however, that sleep() is called.



Awake and sleep are both called while in the forward() call to a new servlet. The forwarding servlet (the one calling forward()) does not finish processing until after the forward() call is through, so the forwarding servlet will not go to sleep until then.

ServletA forwarding to Servlet B, the steps on the servlets are along the lines of the following with some processing left out.

ServletA
A.awake()
A.respond()
... process response and determine need to forward...
A.forward( URL to servlet B )
createServletInTransaction() locates the servlet and attaches it to the transaction.
B.awake(0
B.respond()
B.sleep()
A.sleep()

You can check request.parent() to see if you are in a forwarded or included requestt, it returns the parent servlet, or None if there is none.

Note that this behavior is similar for forard() includeURL() and callMethodOfServlet().

-Stuart-



-------------------------------------------------------
This SF.net email is sponsored by: Scholarships for Techies!
Can't afford IT training? All 2003 ictp students receive scholarships.
Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
www.ictp.com/training/sourceforge.asp
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss


Reply via email to