community postPlatform, DevOps & Performancecommunity - not Microsoftreviewed - checked by Opus

LockTimeoutDuration in AL

Starting with Business Central 2025 Wave 2 (v27), AL code can call Database.LockTimeoutDuration to raise or lower the lock timeout for a specific statement, overriding the global value (30 seconds online, 10 seconds in a v27 on-premises demo database). Setting it to 0 is capped by the platform at 1,710,000 ms (28.5 minutes). The author advises using it only for critical procedures, since low values cause more timeout errors and high values risk blocking chains and deadlocks.

post Dynamics 365 Business Central tales, myths, legends. And something serious.

Duilio Tacconi · 2025-12-10 · 920 words · about 4 min

"With great power (define a lock timeout) comes great responsibility (you are accountable of the consequences: good and bad)."

Key points

  • Database.LockTimeoutDuration was introduced in BC 2025 Wave 2 (v27) to allow per-statement lock timeout overrides in AL code
  • Online environments have a 30-second default timeout; on-premises defaults to 10 seconds from the $ndo$dbproperty table
  • Lock timeout values are limited to a maximum of 1.71 million milliseconds (28.5 minutes), which is 10 percent below the command timeout to distinguish between lock and command timeouts
  • Setting timeout values too low increases timeout errors and rollbacks; setting them too high risks deadlocks and blocking chains
  • This feature should be used sparingly for specific business-critical procedures that encounter lock timeouts, not as a general solution to locking problems

Quotes

  • “With great power (define a lock timeout) comes great responsibility (you are accountable of the consequences: good and bad).” (This emphasizes that using this feature requires careful consideration to avoid introducing deadlocks and performance problems.)

AL objects mentioned

As named in the post. A name that matches one object page by exact type and name links to it; the others stay as named.

  • other “Database.LockTimeoutDuration Method”

Context

  • Features: lock timeout duration override, statement-level timeout configuration, database locking control
  • Versions: 27, 2025 Wave 2

Source: Duilio Tacconi, community blog. Summary, key points and quotes are derived (CONTENT-NOTICE.md); read the original for the full text.