Read Physical and Read by ISN

Hey Guys,

Note - Before asking the question, I googled, searched in softwareag and also tried with a sample code. But I didnt get an answer.

I was trying to find the disadvantage of using Update with Read physical. I read in a resource that Read by ISN is preferred compared to Read Physical to do updates. “Potential Double updates problem” in read physical wont be present using Read by ISN.

So anybody can explain about this issue? I tried updating all the records of a file for one field using Read physical and I didnt get any issue.

Regards,
Vasanth

Hi Vasanth,

With a read physical, Adabas reads the file’s data blocks (RABNs) in physical sequence and processes the records within them.

Sometimes when Adabas updates a record, it no longer fits in the original block and the record is migrated to another data storage block. If the record moves to a higher RABN, the record will be processed again when the physical read reaches it.

It is also possible for another user to cause a record to be migrated to a RABN you have already processed and for that record not to be included in your update.

Reading in ISN sequence avoids these problems.

Cheers, Graeme

1 Like

Hi Graeme,

Thanks for the quick reply. Got a lot of clarity now.

I have a follow up questions.

Using Read physical don’t we keep the entire database under hold? If yes how is your below statement possible?

"It is also possible for another user to cause a record to be migrated to a RABN you have already processed and for that record not to be included in your update. "

Regards,
Vasanth

Under NO circumstance you will EVER have “the entire database under hold”,
not even the whole file, single records will be put in hold as you go by and
access them, only as long as you yourself dictate, they will be released again
with either END TRANSACTION or BACKOUT TRANSACTION.

Ok got it :slight_smile:

So If I have a record A in block 1 which I already updated and then released.

Another user updated it and because of that record A got migrated to block 99, which I didn’t update yet.

So this causes a second update on this record. So my understanding is right?

Yes, unless you take precautions like keeping an “last modified” date etc. and skipping the record when you hit it the 2nd time.