Hi, My name is Soumitra Dutta, an Oxford-based entrepreneur & photographer. I have a question about Adabas ISN assignment and would appreciate your suggestions.
When inserting a new record into an Adabas file, how does Adabas decide which ISN (Internal Sequence Number) to assign? Does it always generate the next sequential ISN, or can it reuse ISNs from deleted records depending on the file settings?
If anyone has experience with this or can explain the internal logic behind ISN allocation, please share your insights or examples.
Regards
Soumitra Dutta
there is a file level option to re-use ISNs that have been released by deleting records (REUSEISN=ON) or only to assign new ISNs (REUSEISN=OFF)
It’s been a while now since I taught ADABAS internals but unless it has changed here is some additional information to what Doug has correctly stated. First if REUSEISN is turned OFF by default as Doug said the next higher ISN is always assigned. This is very useful for applications that need a sequential control number that isn’t reused. However for files that have a lot of ADD/DELETE activity where the ISN is not important you might consider turning it ON to reduce the growth of the Address converter. A good example of this is the NATURAL FUSER file. When you do a SAVE or STOW NATURAL generates a transaction where it ADD’s the new records (representing the code) deletes the old records and does an ET. So it is normally recommended to turn ISNREUSE=ON for FUSER file.
Now for the rest of the story…
Even if you have turned ISNREUSE on it is possible for the AC to grow. Here is what happens when you add a record to a file.
-
ADABAS checks the files FCB to see if there is an ISN available for REUSE. It keeps a list of eight there.
-
ADABAS also keeps a pointer in the FCB to the current location in the AC. The rule is that ADABAS will only read up to one AC block to refill the list of eight available ISN’s for reuse.
-
If ADABAS does not find any ISN’s available for reuse it will set the location pointer to the next AC block but then assign the new record an ISN equal to TOP ISN plus one. This is done for performance so that an ADD does not cause a scan of the whole AC (lots of IO).
Hope this helps those inquiring minds…
Eugene (Gene) Miklovich
ADABAS/NATURAL Systems Support and DBA
Cell: 916-202-7047
Normal Hours: 8am-4pm E.T.
Please call or text if assistance needed outside these hours.
Out of Office Notice: