How does locktable actualy work ?

Bgestel
Member Posts: 136
Table 37 OnInsert()
TestStatusOpen;
IF Quantity <> 0 THEN
ReserveSalesLine.VerifyQuantity(Rec,xRec);
DocDim.LOCKTABLE;
LOCKTABLE;
SalesHeader."No." := '';
DimMgt.InsertDocDim(
DATABASE::"Sales Line","Document Type","Document No.","Line No.",
"Shortcut Dimension 1 Code","Shortcut Dimension 2 Code");
Above you can see te code that is in the cronus oninsert trigger. Docdim is a local variable btw. so the only statement thats applies on it is the locktable.
In the dimensionmanagement (DimMgt) CU there are no Locktable statement also there are no Findset(true) statements. As you see it does not take the docdim as a parrameter.
Everybody still keeping up :?:
Now when i put some stress on the code i get blocks on the document dimension table. 2seconds and up.
It is a sql 2005 i'm using. And i allready changed the order off the clustered key.
Isn't it strange that the locktable is set on a local variable in the calling table and locks the records from the codeunit.
TestStatusOpen;
IF Quantity <> 0 THEN
ReserveSalesLine.VerifyQuantity(Rec,xRec);
DocDim.LOCKTABLE;
LOCKTABLE;
SalesHeader."No." := '';
DimMgt.InsertDocDim(
DATABASE::"Sales Line","Document Type","Document No.","Line No.",
"Shortcut Dimension 1 Code","Shortcut Dimension 2 Code");
Above you can see te code that is in the cronus oninsert trigger. Docdim is a local variable btw. so the only statement thats applies on it is the locktable.
In the dimensionmanagement (DimMgt) CU there are no Locktable statement also there are no Findset(true) statements. As you see it does not take the docdim as a parrameter.
Everybody still keeping up :?:
Now when i put some stress on the code i get blocks on the document dimension table. 2seconds and up.
It is a sql 2005 i'm using. And i allready changed the order off the clustered key.
Isn't it strange that the locktable is set on a local variable in the calling table and locks the records from the codeunit.
**********************
** SI ** Bert Van Gestel **
**********************
** SI ** Bert Van Gestel **
**********************
0
Comments
-
That should probably say:
IF NOT RECORDLEVELLOCKING THEN DocDim.LOCKTABLE;
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions