[Modeling-cvs] SF.net SVN: modeling: [1003] trunk/ProjectModeling/Modeling/doc/UserGuide/FrameworkTy
Status: Abandoned
Brought to you by:
sbigaret
From: <sbi...@us...> - 2006-04-23 15:10:29
|
Revision: 1003 Author: sbigaret Date: 2006-04-23 08:10:24 -0700 (Sun, 23 Apr 2006) ViewCVS: http://svn.sourceforge.net/modeling/?rev=1003&view=rev Log Message: ----------- Updated: doc. explicitly mention the problems of using ZECS w/ ZEO, and the solutions Modified Paths: -------------- trunk/ProjectModeling/Modeling/doc/UserGuide/FrameworkTypicalUsage.tex Modified: trunk/ProjectModeling/Modeling/doc/UserGuide/FrameworkTypicalUsage.tex =================================================================== --- trunk/ProjectModeling/Modeling/doc/UserGuide/FrameworkTypicalUsage.tex 2006-04-23 13:01:38 UTC (rev 1002) +++ trunk/ProjectModeling/Modeling/doc/UserGuide/FrameworkTypicalUsage.tex 2006-04-23 15:10:24 UTC (rev 1003) @@ -238,23 +238,64 @@ \label{fig:enable-bind-ec-txn-to-zope-txn} \end{figure} -%% \begin{figure} -%% \ifpdf -%% \includegraphics[width=\textwidth]{./UserGuide/ZECS} -%% \else -%% \begin{htmlonly} % HTML -%% \htmladdimg{ZECS} -%% \end{htmlonly} -%% \fi -%% %begin{latexonly} -%% \ifpdf% PDF -%% \else%LATEX/dvi -%% \fi -%% %end{latexonly} -%% \caption{Binding Zope txn to SESSION's defaultEC() txn} -%% \label{fig:enable-bind-ec-txn-to-zope-txn} -%% \end{figure} +\subsection{ZEO\label{framework-integration-zope-zeo}} +Projects using ZEO should take extra care before using the +\module{ZEditingContextSessioning} (ZECS) product. + +In ZEO environments, different Zope processes are launched. The problem is +that the ZECS product is designed to work in a MT environment, but it {\bf +cannot} share EditingContexts between different processes. + +The fact is that, you cannot share EC between different processes (so +this is not specific to zeo itself). To do such a thing, it would be +necessary to store the EC in the session along with its pending +insertions/deletions, and the whole graph of objects as well since +pending modifications can exist in-memory. It is not possible in the +current implementation, and there is no plan for making this available +(for example, in the zope/zeo case, this means +that every single object and their attributes should be made +zodb-Persistent so that they can be stored in a session object). + + +In fact, Zope/zeo \& {\sc zodb} address the same problem by opening/ closing a +transaction at the beginning/end of each request loop. In this situation, if +you need to hold back changes between two or three requests/pages, you won't +change the real object in the "main" zodb, rather you'll store the changes in +a session object. + +ZECS faces the same problem. Here are the options you have, in this case: + +\begin{itemize} +\item If every changes made in a request loop is committed/rolled back at the + end of the request, then you'll made changes directly in the object. + You can do the same w/ ZECS: this is why it has an option binding + EC-transactions to zope transactions, + cf.~\ref{framework-integration-zope-options}. + +\item on the other hand, if the modifications of, say, a given objet should be + made accross different requests/pages before being permanently stored in + a db (either zodb, or rdbms), you'll just make it the usual way; e.g. + storing the changes in a session-object, then in the last page, + committing the changes into the object and the DB. + +\end{itemize} + +A third solution is possible, where you can use the ZECS even in +ZEO environment. EditingContext cannot be shared accross +processes, but if you can make sure that a given session is always +served by the same zeoclient, then you'll get back the "full power" of +having a session-EC, with pending (uncommitted) changes crossing the +page requests. + +\paragraph*{Using Pound}~\\ + +\ulink{Pound}{http://www.apsis.ch/pound/} is a load balancer that can +distribute the load among several Zope servers running on top of ZEO. Since +it has a feature that allows to redirect requests to a zeoclient on per +session basis (by IP or user), you can use it to solve the problem of using +ZECS in a ZEO environment. To enable this feature: TODO + %% \section{Others\label{framework-integration-others}} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |