[Zope] More on understanding conflicts

Dennis Allison allison at shasta.stanford.edu
Wed Dec 21 02:52:06 EST 2005


One more thought ---

On Wed, 21 Dec 2005, Chris McDonough wrote:

> > The structure of the method is simple enough: there is a large  
> > <dtml-let>
> > block which populates local variables with data from the session
> > variables
> >
> > 	<dtml-let foobar="getSessionVariable('foobar')"
> >          ...
> >>
> > 	
> > with the body of the <dtml-let> containing 300 lines or so of dtml,
> > control code, sql queries, and occasional dtml-let blocks to hold
> > query results and computed values.
> 
> If this is the same getSessionVariable as you reported before (a  
> Python Script), note that each call that you make to it has  
> overhead.  It might be better to create a single Python script to  
> return all of the values that you need from the session rather than  
> calling this over and over again.  If that doesn't work, it might be  
> even better to just do SESSION.get('foobar') instead of calling a  
> Python Script for every value.
 ...
> Write conflicts happen for a transaction.  In Zope, there is one  
> transaction per request.  

There are two distinct sections to the navigation_box transaction.  One
where the session variables are read and a second where they are used. To
minimize conflicts, the what is now a single tranaction should be split 
into two separate transactions.

Any thought as to how to do that?  If navigation_box were broken into 
two separate methods, say nav_box1 and nav_box2, how does nav_box1 
commit itself and then transfer control and data (a session variable 
snapshot) to nav_box2 as a new transaction? 

I would guess that if nav_box1 redirects to nav_box2 a new transaction 
is initiated and the old one committed.  Is that correct?  And is there 
a better way to get the same effect?





More information about the Zope mailing list