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
0
Comments
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
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.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
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
Consultant-Developper
http://www.CreaChain.com
RIS Plus, LLC
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.
Chris
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,
Nicole
Microsoft Dynamics NAV Partner
Bad Nauheim, Germany
http://www.protakt.de
http://twitter.com/protakt
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.