NoSeriesLine.LOCKTABLE; IF NoSeriesLine.FIND('+') THEN; IF InvtSetup."Automatic Cost Posting" THEN BEGIN GLEntry.LOCKTABLE; IF GLEntry.FIND('+') THEN; END;Before this code there is no SETRANGE or SETFILTER statement for the NoSeriesLine variable. So this code is always picking out the last record in the No. Series Line table. And as this table is hardly updated this statement is always finding the same record, which functionality has no relation with the no. series used in a statement somewhat further down in both codeunits:
TransShptHeader."No. Series" := InvtSetup."Posted Transfer Shpt. Nos.";So my basic question is:
Comments
Just this. Exclusive access, ensuring that the lock actually holds true. Jörg Stryk explained it here.
As for the sense of it, I don't know. There are more strange things in warehouse functionality, like this performance issue. Thanks for pointing it out, though.
with best regards
Jens
Exactly our thoughts when coming across it. Thanx for the confirmation.
For now we have build a workaround for this code which somehow looks like this: The Deadlock Debug field in OurSetup is an option field with OptionString=ORIGINAL,SETRANGE,NOLOCK.
Currently we are using NOLOCK and it seems to work much better then ORIGINAL. We haven't tested SETRANGE yet in production as there was no need for it.
BTW: still interested on other's opinions on this matter.
Never stop learning
Van Vugt's dynamiXs
Dutch Dynamics Community