Skip to main content

Posts

Showing posts from March, 2023

New functionality: Control Database Isolation level on individual reads on a record instance

  Hi, We are familiar with the Record.LockTable property that we use to explicitly lock the table against write transactions that can conflict. By default, Business Central automatically determines the isolation levels used when querying database. AL developers can now explicitly control the database isolation level on individual reads on a record instance. With Business Central v.22, a new ReadIsolation method has been introduced on the record data type.  Its syntax is as: Rec.ReadIsolation := IsolationLevel::<enum value> IsolationLevel can have following values: Default, ReadCommitted, ReadUncommitted, RepeatableRead and UpdLock Example: To understand the concept, we use two simple procedures. One procedure will get customer 10000 and modifies Name while other procedure gets the same customer 10000 and shows the Name. Add these functions to actions on any page, I added them on Customer card using Page Extension. We will call these functions concurrently and one after the other