Assignment of reference numbers

This forum is for eXpress++ general support.
Post Reply
Message
Author
Cliff Wiernik
Posts: 605
Joined: Thu Jan 28, 2010 9:11 pm
Location: Steven Point, Wisconsin USA
Contact:

Assignment of reference numbers

#1 Post by Cliff Wiernik »

In our application, we have a variety of next reference numbers and next numbers assigned to customer accounts/transactions. They are contained in basically 2 files. With these files, to process a transactions, we get a lock on the file, retrieve the variety of numbers and increment the numbers. We may need to increment some numbers several times during the transactions. We will release the lock on the file, as it is used by everyone, as quickly as possible. The numbers may be next customer account numbers, next transaction numbers, next credit bureau numbers, next application numbers and a variety of other next ....... numbers.

This has worked with upwards of 200+ people working on the system at the same time. Sometimes, we run into situations where volume is high and some individuals timeout attempting to access and lock the file to get the next numbers. In the past, we had to break out some of the numbers for one of the departments into its own separate file as automated processes like the posting of cash receipts received via a lockbox would tie up the file for extended periods of time. It would lock/unlock very quickly but because it was automated, it would also relock very quickly.

I am wondering on thoughts and suggestions from others who may have encountered similar situations and have come up with a better solution. We generally need to account for the integrity of all the numbers so that the entire sequence is accounted for.

Cliff

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Assignment of reference numbers

#2 Post by rdonnay »

I have a customer who uses an .ADT file to handle incremental numbers.

The .ADT file will have only one field that is an auto-increment field. When a new record is added, the number is automatically incremented in the new record. This prevents duplicates. You can add an .ADT file to your data-dictionary. You just need to give it a start number.

Code: Select all

FUNCTION GetNextNumber()
LOCAL nNext
USE COUNTER
append blank
dbunlock()
nNext := COUNTER->nc_no
RETURN nNext
The eXpress train is coming - and it has more cars.

Cliff Wiernik
Posts: 605
Joined: Thu Jan 28, 2010 9:11 pm
Location: Steven Point, Wisconsin USA
Contact:

Re: Assignment of reference numbers

#3 Post by Cliff Wiernik »

So is that file constantly adding records and are they deleted at some time?

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Assignment of reference numbers

#4 Post by rdonnay »

Yes. Occasionally he deletes all but the last record.
The eXpress train is coming - and it has more cars.

User avatar
Auge_Ohr
Posts: 1428
Joined: Wed Feb 24, 2010 3:44 pm

Re: Assignment of reference numbers

#5 Post by Auge_Ohr »

what about using UuidCreate() as primary Key ?
greetings by OHR
Jimmy

Cliff Wiernik
Posts: 605
Joined: Thu Jan 28, 2010 9:11 pm
Location: Steven Point, Wisconsin USA
Contact:

Re: Assignment of reference numbers

#6 Post by Cliff Wiernik »

That might work for some items, but then they are not sequential. However, would not work for customer's account number. An 9 digiit number (first 8 significant with a mod 10 check digit as last).

Thanks for the info.

Post Reply