OSB Result Cache
832788Jul 18 2011 — edited Jul 18 2012I have configured a business service to use result caching and am setting the cache token and TTL via a proxy service. The business service performs a query against a database table and returns a result that is cached by OSB using the cache token. When i set the cache TTL value to -1 the result is never cached and any update to the underlying table is returned on the next invocation. If i set the TTL to 30 seconds then obviously i don't see any updates until the TTL has expired.
My question is whether there is any way to expire the cache on demand. That is, I query a value with a TTL of 60 seconds. The value in the table is then updated after 30 seconds. I want to have a service that subscribes to an AQ that is notified when a value changes in the underlying table. When a notification is received i would like the service to re-query the business service expiring the cached result for that value. The reason i want to do this is that the underlying data in the table will generally not change so i can use a very high TTL value. However if they do change then i want the cache to be immediately updated, hence wishing to be able to expire the value.
I have tried many scenarios like performing a query with a TTL of 60 seconds, then updating the underlying value in the table and re querying within the 60 seconds with a TTL of -1. But the value is unchanged util the original TTL expires.
Has any one else tried to do this and been successful. I would have thought that this should be basic functionality. Then only other solution i can think of is to write a custom coherence caching service!