-
1. Re: Control translator cache behavior using Caching API
shawkins Dec 17, 2012 9:17 AM (in response to rokhmanov)Your code and the Teiid unit tests works just fine for me. You have the right idea. By initializing a new CacheDirective to the user scope (or any non-none scope), you will buffer the results for caching until the final values of the directive are check to ensure that you still want the cache entry.
So you are seeing two entries being created in your cache? You can check the Teiid side of the logic in DataTierManagerImpl/CachingTupleSource. The entry should be added in CachingTupleSource line 108, and then read by the next execution in DataTierManagerImpl.registerRequest.
Perhaps your default infinispan-config.xml has been modified to not allow cache entries?
Steve
-
2. Re: Control translator cache behavior using Caching API
rokhmanov Dec 17, 2012 12:22 PM (in response to shawkins)Thanks Steve for advice. I was not completely clear with my problem. Please see updated code in GitHub - I've added a failing test case (it is currently @Ignored). The thing is that I want to change caching behavior between executions by manipulating CacheDirective.setScope() right in Execution class. I am not sure if I do it right.
-
3. Re: Control translator cache behavior using Caching API
shawkins Dec 17, 2012 12:35 PM (in response to rokhmanov)Ah, it's much simplier of a problem then. You're logic will never be hit in the Execution class since the criteria is not currently allowed to be pushed down. Add compare criteria equals support and you should get the behavior you are looking for.
Steve
-
4. Re: Control translator cache behavior using Caching API
rokhmanov Dec 17, 2012 1:21 PM (in response to shawkins)That's what I missed. Thanks Steve!