In Navision Manual says that when you use INSERT, MODIFY or DELETE using SQL Server option, only one record is locked. Is it valid even if the option "always rowlock" is not set TRUE?
The feature "Always Rowlock" just adds the Qury Hint ROWLOCK.
Anyway, SQL Server will alwys start to lock on the lowest possible granularity - record level.
By default SQL Server is able to escalate the locking granularity, e.g. replacing Row-Locks by Range-locks, etc.. The hint ROWLOCK prevents this lock-escaltion; which coould be good or bad (depends).
Hence, even with "Always Rowlock = FALSE" SQL Server will firstly just lock on row-level. Then it depend on the transaction/process if these locks are escalated or not.
Even more important is the usage of LOCKTABLE or FINDSET(TRUE): These commands set the TRANSACTION ISOLATION LEVEL to SERIALIZABLE, means isolating the current transaction from others.
Regardless the setting of "Always Rowlock", here the complete range will be serialized, which could cause blocking conflicts ...
I have another doubt, Navision Manual tells that the Table Transactions are automatically managed by Navision. How this transactions are managed? I mean, an entire codeunit? a function? or what?
Whole "Process run" is a one transaction untill Error or Commit function is called or the process run ends. Because NAV is event driven, each event start new transaction and ends when the trigger ends. You can explicitly commit the transaction or rollback it by Error.
Comments
Anyway, SQL Server will alwys start to lock on the lowest possible granularity - record level.
By default SQL Server is able to escalate the locking granularity, e.g. replacing Row-Locks by Range-locks, etc.. The hint ROWLOCK prevents this lock-escaltion; which coould be good or bad (depends).
Hence, even with "Always Rowlock = FALSE" SQL Server will firstly just lock on row-level. Then it depend on the transaction/process if these locks are escalated or not.
Even more important is the usage of LOCKTABLE or FINDSET(TRUE): These commands set the TRANSACTION ISOLATION LEVEL to SERIALIZABLE, means isolating the current transaction from others.
Regardless the setting of "Always Rowlock", here the complete range will be serialized, which could cause blocking conflicts ...
Regards,
Jörg
NAV/SQL Performance Optimization & Troubleshooting
STRYK System Improvement
The Blog - The Book - The Tool
NAV/SQL Performance Optimization & Troubleshooting
STRYK System Improvement
The Blog - The Book - The Tool
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.