Update of /cvsroot/modeling/ProjectModeling/Modeling/doc/UserGuide
In directory sc8-pr-cvs1:/tmp/cvs-serv10262/doc/UserGuide
Modified Files:
EnvironmentVariables.tex
Log Message:
Added documentation for MDL_ENABLE_SIMPLE_METHOD_CACHE
Index: EnvironmentVariables.tex
===================================================================
RCS file: /cvsroot/modeling/ProjectModeling/Modeling/doc/UserGuide/EnvironmentVariables.tex,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** EnvironmentVariables.tex 4 Jul 2003 17:46:31 -0000 1.9
--- EnvironmentVariables.tex 24 Jul 2003 13:34:06 -0000 1.10
***************
*** 1,2 ****
--- 1,4 ----
+ \newcommand{\inlineverb}[1]{\hspace*{1cm}\code{#1}\newline}
+
\chapter{Environment Variables\label{env-vars}}
***************
*** 20,26 ****
model, like this:\newline
\newline
! \hspace*{1cm}\code{[<ModelName>]}\newline
! \hspace*{1cm}\code{user: <username>}\newline
! \hspace*{1cm}\code{password: <passwd>}\newline
\newline
Then, simply assign to the env. variable \code{MDL_DB_CONNECTIONS_CFG}
--- 22,28 ----
model, like this:\newline
\newline
! \inlineverb{[<ModelName>]}
! \inlineverb{user: <username>}
! \inlineverb{password: <passwd>}
\newline
Then, simply assign to the env. variable \code{MDL_DB_CONNECTIONS_CFG}
***************
*** 45,48 ****
--- 47,87 ----
\hline
\newpage
+ \lineiii{MDL_ENABLE_SIMPLE_METHOD_CACHE}{}{}
+ \lineiii{}{When this variable is set to any non-empty string, the framework
+ automatically caches the simple methods of models and class description (by
+ simple methods, we mean methods taking \code{self} as their only
+ argument). Since both of these objects are heavily used at runtime (because
+ model introspection is needed at various stages), enabling this cache speeds
+ up the simple operations (for example, the inverse relationship for a given
+ relation is computed once, then it is cached).
+ \newline
+ There are situations, however, where you do not want to enable this. For
+ example, if after loading your model you need to change anything in it (such
+ as modifying the connection string, changing an attribute's external type,
+ adding a relationship, etc.), this shouldn't be enabled; if it is, the changes
+ won't have any effect on the model themselves: e.g. you can set the conection
+ dictionary but \method{connectionDictionary()} will keep returning its initial
+ value. In such situations, you can either:
+ \begin{itemize}
+ \item not enable this cache for the whole application,
+ \item or enable it after all changes have been made, by executing the
+ following code:\newline~\newline
+ {\small
+ \inlineverb{import os}
+ \inlineverb{from Modeling.ModelSet import defaultModelSet}
+ \inlineverb{os.environ['MDL\_ENABLE\_SIMPLE\_METHOD\_CACHE']='Y'}
+ \inlineverb{for model in defaultModelSet().models():}
+ \inlineverb{~~model.cacheSimpleMethods()}
+ }\newline
+ %\end{verbatim}
+ Attention: once the caching mechanism has been enabled, it cannot be disabled
+ (so no more changes can be made to your models)
+ \end{itemize}
+ Note: The environment variable \code{MDL_DB_CONNECTIONS_CFG} is taken into
+ account to update a model's properties before it is cached, no particular
+ action needs to be taken in this case.}
+ {e.g. '1', 'YES' (plus the empty string for de-activation)}
+
+ \hline
\lineiii{MDL_PERMANENT_DB_CONNECTION}{}{}
\lineiii{}{By default, the database connection is closed each time the last
***************
*** 63,66 ****
--- 102,106 ----
\end{longtableiii}
+ \newpage
\section{Postgresql specific\label{env-vars-postgresql}}
|