Using NAV2009 SP1 RTC. It's an elusive problem that I can never replicate.
Basically, there are times whent he No. Series set on the Sales Order that does not increment properly, causing the user to receive the "Order No. xxx already exist" error.
For people using the RTC, have you entered this problem before?
We do have a process that automatically creates the sales order, but I can't imagine that would cause the problem?
0
Comments
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
I don't think that's possible in the production environment. I've tried, in vain, different methods to recreate the problem, but couldn't.
I'm thinking that a roll back occured on the number series, or mutliple lock was called on that table and the database couldn't update fast enough?
Is that even possible?
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
maybe you could log the timestamps of the GetNextNo/TryGetNextNo calls (and nested call states). This should only marginally affect a production environment. I'd go at it with a log table and OnEntry/OnExit functions
with best regards
Jens
Thanks for the tip. But how would logging the timestamp of these function help me troubleshoot the problem?
Usually, when the user gets this error, they call me right away so I have a sense of when it happens. The problem is they have about 20-30 people entering orders throughout the day, and it happens randomly.
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
I have the same issue with NAV 4 SP3..
Still search for the solutions..
Johanna
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
We have both "Default Nos." & "Manual Nos." checked.
IF someone types in the next order number instead of F3 the "Last No Used" stays where it is.
So the next time someone F3's or some code is executed to run the No Series that error appears.
Doesn't happen often, most people f3 - but there's always that occasional hiccup.
So the quick fix is Drill into No Series->Drill into "Last No Used" and update it to the actual next available number to be used"
Don't know if it applies here - but I thought I'd share.
http://www.BiloBeauty.com
http://www.autismspeaks.org
the behaviour on the SQL side seems to be different with RTC. I've traced both the CC and the RTC. Both do a "set transaction isolation level serializable" on the locktable(), at least you can see it in both traces. But the question is when that happens. In the code of CU396:GetNextNo() there is some code between the locktable and the findfirst() which results in a "select * with updlock from No_ Series Line". I would suspect that not every action that results in an SQL statement on CC will result in an SQL statement in the Service Tier. AFAICR the Service Tier does some caching on its own - or at least it seemed this way to me.
I'm afraid that proving this (maybe) bug will be quite difficult. Logging the entry/exit order of the GetNextNo() request would help, but you would still have the problem.
What you can try is verifying that you have the lock on the NoSeriesLine before doing the increment. The idea is this:
- SQL Server automatically places a row lock on a record that is modified or inserted.
- A modify can fail if somebody else was faster. Try again with a locktable, in this case the client waits until
it can place a lock or it times out.
- If we write a unique value into our record, modify it and read it back, we can safely assume we have a row lock. A suitable unique value would be the connection ID of our session.
The code for the change will look like this:
- T309: Add a field named "Connection ID", type BigInteger.
- C396: In function GetNextNo() add two local variables:
L_Session Record Session
L_RetryCount Integer
The code for the changed function is here:
You also need a suitable text constant for "ErrorNoSeriesLocking". To use the session table you need additional rights (select permision) on the dbo.Session view.
I think it's worth a try - doing the modify should force the locking of the row. Since every client does the same, the No. Series should increment as intended.
with best regards
Jens
I want to report this as a bug to Microsoft but I can't replicated it.
But this is still a problem, a rather annoying problem. It doesn't seem like there's a solution for this other than to wait until Microsoft finds out about this?
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book