This post is part of the New Functionality In Microsoft Dynamics 365 Business Central 2023 Wave 1 series in which I am taking a look at the new functionality introduced in Microsoft Dynamics 365 Business Central 2023 Wave 1.
The sixth of the new functionality in the Development section is Control Database Locking Behaviour.
Database locking is a main root cause for performance issues. When AL code takes fewer locks, it increases the performance of the system for end users.
Enabled for: Admins, makers, marketers, or analysts, automatically
Public Preview: Apr 2023
General Availability: Apr 2023
Feature Details
By default, the runtime of Business Central automatically determines the isolation levels used when querying the database. AL developers can now explicitly control the database isolation level on individual reads on a record instance.
A new ReadIsolation method has been introduced on the record data type. The method has the following syntax:
rec.ReadIsolation := IsolationLevel::
The method can also be invoked using property access syntax.
The following table describes the possible IsolationLevel values:
- Default: Follows the table’s isolation level for reads; same behavior as not setting an IsolationLevel.
- ReadUncommitted: Allows the record to read data that has been modified by other transactions but not yet committed (also called dirty reads). A ReadUncommitted transaction takes no locks and ignores locks from other transactions.
- RepeatableRead: Ensures that reads stay stable for the life of the current transaction. Until the current transaction completes, the record can’t read data that has been modified but not yet committed by other transactions and other transactions can’t modify data that has been read by the current transaction.
- UpdLock: Ensures that reads stay consistent for the life of the current transaction. Until the current transaction completes, the record can’t read data that has been modified but not yet committed by other transactions and other transactions with the same isolation level can’t read data that was read by the record.
New Functionality In Microsoft Dynamics 365 Business Central 2023 Wave 1
What should we write about next?
If there is a topic which fits the typical ones of this site, which you would like to see me write about, please use the form, below, to submit your idea.