Bug 38729

Summary: Doctype cache not cleared when document is deleted
Product: Lenya Reporter: Andreas Hartmann <andreas>
Component: MiscellaneousAssignee: Lenya Developers <dev>
Status: NEW ---    
Severity: normal    
Priority: P2    
Version: 1.2.5   
Target Milestone: 1.2.6   
Hardware: Other   
OS: other   

Description Andreas Hartmann 2006-02-21 10:00:58 UTC
Scenario:

- create document with doctype A
- delete document
- create document with same document ID and doctype B
- Lenya still resolves the doctype A

When a document is deleted, its doctype reference has to be removed from the cache.
Comment 1 Dominique De Munck 2006-04-05 09:03:20 UTC
This issue is really anoying, is there any way we could fix this in 1.2.4 (apart
from restarting the server) ? 
Where is the doctype cache stored ?

thx,

Dominique De Munck
Comment 2 Andreas Hartmann 2006-04-05 09:14:59 UTC
With the 1.2 architecture, it will be quite hard to fix this. There is no
central place where document handling happens, so we can't apply the observer
pattern to trigger a doctype cache refresh.

A workaround would be to clear the cache when a sitetree node is deleted or moved.
Comment 3 Andreas Hartmann 2006-04-05 09:18:44 UTC
BTW, the caching happens in URIParameterizerImpl.
Comment 4 Dominique De Munck 2006-04-05 09:51:19 UTC
(In reply to comment #3)
> BTW, the caching happens in URIParameterizerImpl.

how do I clear this cache from within for example
DefaultSitetree.save() ? I do see a URIParameterizerImpl
cache object, but this one is private.
I could just cut the caching out of URIParameterizerImpl altogether ?

thx,

Dominique
Comment 5 Andreas Hartmann 2006-04-05 09:57:31 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > BTW, the caching happens in URIParameterizerImpl.
> 
> how do I clear this cache from within for example
> DefaultSitetree.save() ?

This won't be easy because the Sitetree isn't an Avalon component yet and
therefore has no access to the URIParameterizer.

> I do see a URIParameterizerImpl
> cache object, but this one is private.

The ability to clear the cache would have to be added to the URIParameterizer
interface.

> I could just cut the caching out of URIParameterizerImpl altogether ?

The easiest way would be to make URIParameterizerImpl configurable and allow to
set the CACHE_CAPACITY in cocoon.xconf.

Comment 6 Andreas Hartmann 2006-04-05 09:58:27 UTC
> > I could just cut the caching out of URIParameterizerImpl altogether ?
> 
> The easiest way would be to make URIParameterizerImpl configurable and allow to
> set the CACHE_CAPACITY in cocoon.xconf.

BTW, there could be a quite serious performance penalty. I would recommend to do
load tests before and after the change.