4 Replies Latest reply on Dec 17, 2012 1:21 PM by Andriy Rokhmanov

    Control translator cache behavior using Caching API

    Andriy Rokhmanov Newbie

      Hi, I have a question about proper use of Caching API in custom translator. My much simplified task is to dynamically control caching for a specific model by some external parameter (for example by system load, or by some complex time algorythm). Would it be possible with just Caching API, without using cache hints or matviews?

      I did a quick look on Caching API, per my understanding I can enable caching in translator when my ExecutionFactory returns the properly built CacheDirective object by overriding the default getCacheDirective(). Can I modify the CacheDirective in my Execution? I've tried to modify CacheDirective obtained from ExecutionContext, but it seems causing no effect ( https://github.com/rokhmanov/teiid-test/tree/master/caching-api ). Am I doing somethign wrong?

       

      Thanks,

      Andriy