No, its not retrieved from EDITracking table for sure. That table is for 997âs. Envelope services are getting control numbers from EDI Control number table which weâve configured from Admin page.
Here is the scenario my question for:
Iâm running service âwm.b2b.edi.util:controlNumberâ independently. first time when I ran I get 136340315 , second time when I ran I get 137340315.
where exactly did it store that first number so that it can generate the next number when I ran second time?
Sorry you are right I was in different mind setâŚyou are almost there:
Next number retrieves from the table:
Obtaining Control Numbers for Outbound Processing (ANSI X12 and
UN/EDIFACT):
The EDI Module maintains information about control numbers in the EDIControlNumber table, which is an EDI Moduleâspecific table in the Trading
Networks database.
Defining Control Number Settings covers the topic:
You can review the user guide for more basic information
No Problem.
EDI ControlNumber table will have control numbers defined for specific sender, receiver and group type from Admin page.
Service âwm.b2b.edi.util:controlNumberâ isnât related to that table since this doesnât take any defined sender or receiver as inputs. This service is to generate a unique number every time irrespective of any situation. It works totally independently.
but, when it generates it caches the value somewhere so that it can use it for next time.
Iâm missing the point where it stores? Please anybody help
The control number is a nine-digit number, based on a two-digit day, two-digit hours,
two-digit minutes, and a random three-digit system count (100-999).
âThis service is to generate a unique number every time irrespective of any situation.â
No, it really doesnât do this. IME, this service is all but useless. As rmg notes, it does not track which control numbers it has handed out. It does not cache any value.
If you run this service twice, youâll see the second number is subsequent number to the first one.
I was trying to figure out where exactly it stores the first number to create the second. Of course that idea is turned out to be a dud. I figured better to avoid using this service rather use DB sequence number stuff.
But anyways, you are right. this service is useless. from my testing, it is generating unique numbers when running as multiple threads on one server. but when I run this service, from multiple servers in one cluster with multiple threads which share same database, its surely generating duplicates since its not synchronized across cluster.
In memory it keeps what the service description refers to as the ârandom system number.â So it keeps only that portion, not the entire the string. On restart, the ârandomâ number sequence will restart. And as youâve noted, multiple IS instances can and will create the same number.
Iâve found it best to use the EDIControlNumber table. Doing so follows the common practice of using sequential control numbers for group and interchange envelopes to support tracking and control number gap detection. (If youâre not already aware, the common practice for tx sets is to always start at 1 and do +1 for each tx set within a single group.)
As previously stated nothing stored in memory and theory of that service is:
The control number is a nine-digit number, based on a two-digit day, two-digit hours,
two-digit minutes, and a random three-digit system count (100-999)
Yes I seen the issue about dup cntrl number issues in the IS cluster environment: