On Fri, 2005-08-26 at 16:48 +0200, Andreas Hartmann wrote:
> Josias Thoeny wrote:
> > Hi,
> > 
> > Just noticed that for each request for a document in lenya-trunk, the
> > DefaultDocument class gets instantiated about 300 times (put some debug
> > output into the constructor to see it).
> > Could the DocumentBuilder somehow use the DocumentIdentityMap to prevent
> > multiple document instantiation?
> > Or might that lead to problems, e.g. with synchronization if multiple
> > threads access the same document simultaneously?
> 
> I guess that the main reason for this behaviour is that the preconditions
> are verified for all usecases which are available in the menubar.
> 
> If we allow to show the menu during usecase execution (which is possible
> at the moment, for instance in the site area), each usecase has to create
> its own distinct identity map. If they would use a shared identity map
> which is attached e.g. to the request, all usecases whould see the changes
> which were made by the active usecase. This way, the precondition check
> could be skewed.
> 
> What we could try is to use a distinct identity map for the active usecase
> and a shared identity map for all inactive usecases (which should have no
> write access to avoid interference).

Looks like I do not completely understand the idea behind the
DocumentIdentityMap (yet).
So each usecase has its own identity map in order to have a view of the
content which is independent from the other usecases? 
Does that mean that two instances of the same document stored in two
different identity maps may have different meta data, workflow, or
actual document content? 

Another question: Where in the code are documents added to the identity
map? I expected this to happen in DefaultDocumentBuilder or
DefaultDocument, but I wasn't able to figure it out.

Thanks in advance for an explanation. (I'm just trying to get a better
understanding of the matter.)

  Josias


> 
> 
> > Something similar happens with the metadata. The meta data file is
> > parsed about 20 times for each request. But probably if there was only
> > one document instance, this would not happen anymore.
> 
> This is the same issue as above.
> 
> -- Andreas
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to