I have a table which has those properties:
CacheLookup = FoundAndEmpty
SaveDataPerCompany = Yes.
From the UI, we need to retrieve data not based on current login company, so we use crossCompany to query data. Most of time we are able to get the correct data as we expect regardless the different login company. Unfortunately sometimes we couldn’t get data return. We know there are data in database. It looks like to me the query didn’t access database, might access the cache instead.
I wonder what the better solution for this will be. Should I set CacheLookup=none for this table?
Any hints from your expertise and experience will be appreciated.
Nancy
Hi Nancy,
It depends on the contents and use of this table. Setting the cahce to None could help, but can slow down other processes.
You can flush the cache with a keyword as well:
YourTable yourTable;
flush yourTable;
First verify that the issue is really related to single-record caching. I’ll assume it is, although the assumption may be wrong, but I have no means to test it.
If the table is used in such a manner than getting data from cache is unacceptable, you shouldn’t use such a kind cache. A usual workaround is using NotInTTS cache and doing everything sensitive in a transaction.
If your case is truly exceptional and you want a static cache in other cases, you can explicitly bypass cache (xRecord.disableCache()).
(Question moved to the Developer forum.)