使用多个AOS时,如何确保方法可以访问最新数据?

时间:2023-02-15 20:47:41

Our environment consist of 5 AOS running AX2012 R2 CU6.

我们的环境包括5个运行AX2012 R2 CU6的AOS。

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.

在当前场景中,用户使用新记录填充许多表。在特定AOS上设置WebService以检索数据。

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.

似乎WebService永远不会获得“新”数据(除非重新调整AOS),因为这些记录是在另一个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).

什么是确保WS可以访问最新数据的最佳方法?我想要一个服务器端解决方案(尝试在WS代码中实现一些appl.globalCache()。clear()方法,目前为止没有任何成功)。

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

填充的数据结构中的所有表的属性“CacheLookup”都设置为“NotInTTS”。

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

此外,当使用WS AOS上的工具 - >缓存 - >刷新元素菜单项时,我们的Web服务立即返回正确的数据......

3 个解决方案

#1


1  

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

当您使用NotInTTS缓存表时,可以将数据检索放在事务中:

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.

冲洗现金可能有效,但会破坏他们的目的。

#2


0  

Flush the table cache

刷新表缓存

YoutTableName cachedBuffer;
flush YoutTableName;

Alternatice you can call Dictionary::dataFlush

Alternatice你可以调用Dictionary :: dataFlush

Dictionary::dataFlush(tableNum(YourTableName));

or else you can call the for all tables

或者你可以调用所有表格

SysFlushData::doFlush();

#3


0  

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

您还可以尝试在记录缓冲区上禁用Cache

#1


1  

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

当您使用NotInTTS缓存表时,可以将数据检索放在事务中:

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.

冲洗现金可能有效,但会破坏他们的目的。

#2


0  

Flush the table cache

刷新表缓存

YoutTableName cachedBuffer;
flush YoutTableName;

Alternatice you can call Dictionary::dataFlush

Alternatice你可以调用Dictionary :: dataFlush

Dictionary::dataFlush(tableNum(YourTableName));

or else you can call the for all tables

或者你可以调用所有表格

SysFlushData::doFlush();

#3


0  

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

您还可以尝试在记录缓冲区上禁用Cache