[Zope] More on understanding conflicts

Maciej Wisniowski maciej.wisniowski at coig.katowice.pl
Wed Dec 21 05:45:06 EST 2005


>
>
>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?
>  
>
Hi
You've written in your first post that you're dealing with read conflict 
errors
so I think transaction commiting is not the point here - it would cause
write conflict. Am I right?

I think that few simple things you can do is using external method 
instead of
your's python script getSessionVariable (to make it faster) and redesigning
it's code that it returns (at once) for example a dictionary filled with 
requested
values from session. Maybe you can use external method to generate whole
navigation. The best thing would be to write product but this is a bit 
more work,
and I think external methods are much faster to check in your situation.

Other thing you can do is to use ZopeProfiler to see exactly what is called
when the page is requested and how long it takes.

Other quick solution, which may not be appropiate in your case, is to
render navigation box once and store whole the generated code in session.

-- 
Maciej Wisniowski


More information about the Zope mailing list