SelectLocked method at table level

Hi Everyone,

In some of the find methods of tables I see selectLocked method as shown following code:

I searched for it but not got enough information. can you please tell whether it is also used for caching or some other purpose.

salesTable.selectLocked (_forUpdate);

select firstonly salesTable
where salesTable.SalesId == salesId;

I see some where Caching type NotInTTS written as following:

Not in TTS:

All successful caching key selects are cached.

When in a transaction (after ttsBegin), no caches made outside the transaction are used. When inside a transaction, the record is read once from database and subsequently from cache. The record is select-locked when read in a transaction, which ensures that the record cached is not updated while the transaction is active.

Thanks

It would be related to locking in database, not to caching, but I think it’s obsolete and it’s kept in code just because nobody has bothered to remove it.

Thanks Martin. I see this SelectLocked at very few tables like salesTable and PurchTable. I am really confused when to use them. Your answer “Might be Obsolute” looks great.

I’ve never used it and I recommend the same to you. :slight_smile: