[Zope] Re: HappySession

Diego Rodrigo Neufert diego@magicwebdesign.com.br
Fri, 1 Sep 2000 08:09:43 -0300


Well, this problem just accours when I restart the server or I stay too much
time idle and the session expires...
The frame[0] (the first to be loaded) show a session not found message and in
frame[1] I got this error:
Error Type: KeyError
Error Value: NDxCfgEr_89YtG
So, if I refesh the page zope show me the transaction error and everything
stops working.... I need to restart zope and my netscape (to clean all cookies)
to get things working again....
Here's my session not found page but this error occours when I doesnt have one
too... well, in the standard html header I call call a method that do a call in
all my sessions.... I have two SESSION objects, one in the root of zope and
other in the opt folder of zope.... look how I call the SESSIONS....
in standard_html_header
<dtml-call callSession>

The callSession method:
<dtml-call SESSION>
<dtml-call opt.SESSION>

 session_not_found_html:
<dtml-var standard_html_header>
<font face=Arial size=2>
O tempo m&aacute;ximo de dura&ccedil;&atilde;o foi ultrapassado.<br>
Os items existentes no seu carrinho foram apagados.<br><br>
Continue suas compras normalmente agora...
</font>
<dtml-var standard_html_footer>


On Thu, 31 Aug 2000, you wrote:
> My conjecture now is that your error-handling HTML might be accessing 
> attributes from Zope server. A more correct way of handling exceptions 
> should have been using the <dtml-try>...<dtml-except>...</dtml-try> block. 
> But I kind of make a cheat sheet recipe recommendation, tweaking the 
> standard_error_message, which was not a good idea. When Zope arrives to 
> standard_error_message, the transaction has been aborted and if your 
> session_not_found_html is not simple enough and uses more DTML features, I 
> can see that it can cause transaction error.
> 
> Can you send me your session_not_found_html? I think this was the problem.
> 
> In the future I will remove the standard_error_message trick from the help 
> file and instead tell people to use proper exception handling, which is the 
> right way of doing things. But it will require people to structure their 
> sites more carefully so they can catch the SessionNotFound exception. 
> Basically, it is recommended that you have single (or few) index_html on 
> your site, and place a <dtml-try>...<dtml-except ...>...</dtml-try> block to 
> capture all exceptions from Zope and deal with them. It's the right way of 
> doing things, it's just that many people tend to have many index_html and it 
> will make their site harder to catch exceptions and deal with them in a 
> centralized way.
> 
> In short, HappySession itself is probably not the cause of the transaction 
> error. The problem probably comes from bad exception handling. If you want 
> to use the standard_error_message trick, then please use a simple html page 
> for session_not_found_html without additional Zope features. If I find out 
> more, I'll let you know.
> 
> regards,
> 
> Hung Jung
> 
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
> 
> Share information about yourself, create your own public profile at 
> http://profiles.msn.com.
-- 
---------------------------
Diego Rodrigo Neufert
-webmaster
---------------------------
(Magic Web Design)
(email) (diego@magicwebdesign.com.br)
(curitiba) (pr)