Hi Everyone,
I'm having an issue with static attributes for an event frame not getting the most recent values. Here is what I am doing:
This is the test code:
List < AFSearchToken > tokenList = new List<AFSearchToken>(); var name = "T001 - 2018-05-23 21:20:19.000"; tokenList.Add(new AFSearchToken(AFSearchFilter.Name, AFSearchOperator.Equal, name)); var search = new AFEventFrameSearch(afDb, "optional name", tokenList); var data = search.FindEventFrames(pageSize: 1, startIndex: 0, fullLoad: true); foreach (var e in data) { Console.WriteLine($"{e.Name}"); foreach (var attribute in e.Attributes) { var value = attribute.GetValue(); Console.WriteLine($"{attribute.Name} - {value.ToString()}"); } }
I repeat this query (without closing my connection) and get back the same values, even after I make a change to an attribute using PSE. If I restart the application I get the new values, if I do a afDb.Refresh(), I get the new values. Is this the intended behavior?
Any help would be greatly appreciated!
Lonnie
This is what I get for not testing it first. This seems to be the intended behavior. "Configuration Item" affects the editing semantics (requires checkin to edit), but NOT the retrieval semantics. You must refresh in order to get the latest values for static attributes. You should try using AFDatabase.Refresh first. If that's not working for you then you might consider one of the more complicated/expensive ideas I mentioned above.