LOCKTABLE & SQL in 3.7a

AdvStore
Member Posts: 14
Hi, I've got kind of a strange one. We just got a new server for running Navision with SQL and I'm doing some testing. For some reason, navision seems to be doing a LOCKTABLE even with simple MODIFY and DELETE instructions - LOCKTABLE is not being called explicity.
I wrote a routine to quickly run through the Location table and perform a MODIFY on each record. In the client monitor, it shows a LOCKTABLE instruction before it start doing the modifies.
Has anybody seen this behavior before or have an explanation? Am I reading the client monitor wrong?
Thanks,
Chris
I wrote a routine to quickly run through the Location table and perform a MODIFY on each record. In the client monitor, it shows a LOCKTABLE instruction before it start doing the modifies.
Has anybody seen this behavior before or have an explanation? Am I reading the client monitor wrong?
Thanks,
Chris
0
Comments
-
I think that you have some overlooked locktable somewhere (try to run client monitor and code coverage and process the data through extended client monitor and look, where the locktable is called in code), because modify only lock record, and if you can see in client monitor locktable, it means, that it is somewhere explicitly called...0
-
Here the code:
IF location.FIND('-') THEN REPEAT
location.MODIFY;
UNTIL location.NEXT = 0;
There are no ranges set and no explicit call to LOCKTABLE. I know this should only do row level locking, but the client monitor show "LOCKTABLE". Perplexing.0 -
-
Hi,
According to my information, SQL doesn't lock a table when you place the locktable command.
But, it is very important to use the right key. You MUST always add the setcurrentkey command. Also the setrange and setfilter commands afterwards MUST be placed in the same order as the fields of the key used. Also the there may be no holes left in those fields compared to the key, and ofcourse you may not filter on fields not in the key.
If you don't follow these rules by SQL your application will work but you have performance loss. I geuss this is happening at your server.
Also do check chapter Performance of Application Designer Guide, which you can find on product CD
Francois0 -
Is it maybe because you don't set any filters on the Location table, that Navision recognizes that you're accessing all the records and locks the table? I am just brainstorming, I don't actually know
. Have you tried setting filters though and checked what happens?
0 -
Hi,
I just got a response from our Navision vendor who contacted somebody from Microsoft - it looks like the tables are not actually being locked, but the client monitor is just displaying the CA/L code. Thanks for the responses.
Chris0 -
fl wrote:Hi,
According to my information, SQL doesn't lock a table when you place the locktable command.
But, it is very important to use the right key. You MUST always add the setcurrentkey command. Also the setrange and setfilter commands afterwards MUST be placed in the same order as the fields of the key used. Also the there may be no holes left in those fields compared to the key, and ofcourse you may not filter on fields not in the key.
If you don't follow these rules by SQL your application will work but you have performance loss. I geuss this is happening at your server.
Also do check chapter Performance of Application Designer Guide, which you can find on product CD
Francois
Hi everybody,
do you know if there is a written document where I can read something about this "SQL programming rules" that Francois mentioned? I always hear about special programming for SQL but I still don't know exactly how to do it or at least where to get informations about it. Would be interesting..
Thanks for your hints.
Regards,
NicoleProTAKT Projekte & Business Software AG
Microsoft Dynamics NAV Partner
Bad Nauheim, Germany
http://www.protakt.de
http://twitter.com/protakt0 -
May be that better will be wait for SP1, because there will be (I hope) some more documentation, because in SP 1 there are new COMMANDS for programming under MS SQL...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