UPDLOCK when using a ISEMPTY

rcverbeek
Member Posts: 32
in SQL General
Hi,
Recently one of our customers is having deadlock issues on their NAV 2018 environment. In one specific case we captured the deadlock trace using SQL Profiler. The victim process was trying to get an exclusive lock for performing a DELETE. The other process had this SQL command:
To my knowledge the IS NULL is only issued with an ISEMPTY statement. There are two ISEMPTY statemenst found in the entire code.
The UPDLOCK hint baffles me: why on earth does an ISEMPTY lead to an UPDLOCK hint? There are no LOCKTABLE's involved.
Any ideas?
Thanks
Recently one of our customers is having deadlock issues on their NAV 2018 environment. In one specific case we captured the deadlock trace using SQL Profiler. The victim process was trying to get an exclusive lock for performing a DELETE. The other process had this SQL command:
SELECT TOP 1 NULL FROM "some db".dbo."some prefix$some table" "77047" WITH(UPDLOCK) WHERE ("77047"."Document No_"=@0 AND "77047"."AS400 History"=@1) OPTION(OPTIMIZE FOR UNKNOWN)
To my knowledge the IS NULL is only issued with an ISEMPTY statement. There are two ISEMPTY statemenst found in the entire code.
The UPDLOCK hint baffles me: why on earth does an ISEMPTY lead to an UPDLOCK hint? There are no LOCKTABLE's involved.
Any ideas?
Thanks
0
Best Answer
-
I testet around a bit and could reproduce it. THE MODIFY behaves like a LOCKTABLE
ShipmentMethod.FINDFIRST; ShipmentMethod.MODIFY; IF ShipmentMethod.ISEMPTY THEN;
SELECT TOP 1 NULL FROM "<Company>$Shipment Method" "10"
0
Answers
-
Hey rcverbeek,
I'm facing a similar issue. Do you found the root cause?
Regards
skiddoo0 -
Hi Skiddoo, unfortunately we haven't found the cause.0
-
That's too bad. Thanks anyway. I hope I remember to update this thread once I found the cause.0
-
I testet around a bit and could reproduce it. THE MODIFY behaves like a LOCKTABLE
ShipmentMethod.FINDFIRST; ShipmentMethod.MODIFY; IF ShipmentMethod.ISEMPTY THEN;
SELECT TOP 1 NULL FROM "<Company>$Shipment Method" "10"
0 -
Thanks skiddoo, glad to see you found it!!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