velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve O'Hara <>
Subject RE: Macros interfering with each other when caching turned on
Date Thu, 07 Jun 2012 15:22:17 GMT
Whoops, some more clarity......

We use a custom resource loader that reads templates from a database.  It uses a database
column to determine the last updated date so it can tell Velocity if the template needs reloading
or not.
We also use a pool of Velocity engines.

The problem we have is to do with macros that are contained within an included template.
For example, we have a template called x_dataservice.vm as follows;


The server is multi-tenancy where x is the customer name so we will have the following template
y_dataservice.vm also;


Each lib_macros template is particular to each customer and will contain the same named macros
but with different macro bodies.

When caching is turned on, we get some sort of crossover between all the macros that share
the same name, despite the fact that are loaded from different parents.
To help eliminate our resource loader, I created a custom cache provider so that I could see
that we are definitely hitting the correct templates.  I even changed the isSourceModified
to always return true, to no avail.
As soon as I turn caching off, it all works fine.

I'm wondering if there is some sort of global macro cache because it doesn't seem to be caused
at the template cache level.

Any ideas?


To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message