When using multiple AOS, how can I make sure a method has access to the most recent data?

471 views Asked by At

Our environment consist of 5 AOS running AX2012 R2 CU6.

In the current scenario, users are populating many tables with new records. A WebService is set up on a specific AOS to retrieve the data.

It seems like the "new" data is never obtained by the WebService (unless the AOS is restrated), as these records were created on another AOS.

What would be the best way to ensure the WS has access to the latest data? I would love a server-side solution (tried implementing some appl.globalCache().clear() methods in the WS code without any success so far).

All tables in the data structure that is populated have their attribute "CacheLookup" set to "NotInTTS".

Also, when using the Tools -> Caches --> Refresh Elements menu item on the WS AOS, our webservice immediately returns the right data...

3

There are 3 answers

0
Jan B. Kjeldsen On BEST ANSWER

As your tables are cached using NotInTTS, you can put your data retrieval in a transaction:

ttsbegin;
select ...
ttscommit;
return ...

If this does not work, you may consider it a kernel error, which should be reported.

Flushing cashes may work, but will defeat their purpose.

0
DAXaholic On

You could also give a try to disableCache on the record buffer

0
Matej On

Flush the table cache

YoutTableName cachedBuffer;
flush YoutTableName;

Alternatice you can call Dictionary::dataFlush

Dictionary::dataFlush(tableNum(YourTableName));

or else you can call the for all tables

SysFlushData::doFlush();