Zev.Arnold@Wipro

AF Table Cache Interval

Discussion created by Zev.Arnold@Wipro on Oct 2, 2011
Latest reply on Oct 3, 2011 by Zev.Arnold@Wipro

I'm looking for verification of the exact functionality of the AF Table cache interval with regard to the AF SDK.  My understanding is as follows.

 

When first retrieving an attribute of type Table Lookup Data Reference from AF, the AF SDK caches the AF Attribute object, including the cache interval property of the table the attribute is associated with (perhaps it caches the entire AFTable object?).  With the first call to GetValue for the AFAttribute, the AF SDK retrieves the value from the AF Server and starts a clock.  For all subsequent calls to GetValue, if the clock has not exceeded the cache interval, the AF SDK returns the cached value.  On the first call to GetValue after the expiration of the clock, the AF SDK retrieves a new value for the AFAttribute from the AF Server and caches it for the next cache interval period.

 

The results of the below test code are consistent with the above.  Does this accurately capture the workings of the cache interval property of the AFTable?  Is it then accurate to say that there is one call to the source table per cache interval per client?

 

Thanks,

 

Zev

 

        static void Main(string[] args)
        {
            PISystems pisystem = new PISystems();
            AFDatabase myDB = pisystem["pisystemname"].Databases["databasename"];

            AFAttribute tlValue = myDB.Elements["TL Cache Test"].Attributes["TLValue"];

            while (true)
            {
                Console.WriteLine(System.DateTime.Now + ":" + tlValue.GetValue());
                Thread.Sleep(1000);
            }
        }

 

 

Outcomes