Problem solve Get help with specific problems with your technologies, process and projects.

Working with a single-page subfile

I have read in various subfile books that a single-page subfile should be used while creating an updated subfile. However, the reasons mentioned for this (pertaining to record lock, performance) are not quite clear. Why is it that a load-all or an expanding subfile is not preferred in the case of update subfiles?
The problem is not so much locking, because you would take care not to keep the last record you load into such a subfile locked for update (I hope!); but it is LATENCY -- how long a time passes before the information changed by the user is actually applied to the database.

On a single-page subfile, when the user rolls up or down for the next or previous page, data changed on the current page MUST be validated and applied to the database first. This reduces latency.

With extending or load-all subfiles, paging does not pass control back to the program (except on roll up from the current last page of a self-extending subfile, but that is irrelevant for this discussion). So a long time can pass before changes made to the subfile data get to be validated by your program, and applied to the database. This can cause problems, and can frustrate users who may think that the act of paging has applied the updates (out of sight, out of mind -- and then they press F3).

Whatever method you use, you need to check whether data has been changed by another user or process before you apply valid changes -- if a record changed by the user (in the subfile) has been changed elsewhere since it was put in the subfile, you could flag this as a non-fatal error, highlight the record, and give the user the option to apply his change regardless or insist that he refreshes the screen to see what the data looks like now.

Change detection methods are easier to work with on a single-page subfile, and you are likely to get fewer change clashes anyway and better user satisfaction.

You can get away with a self-extending subfile for updates, if it's unlikely that update clashes will occur.

Please, don't use load-all subfiles. Not just for updates, but for anything, unless the amount of data will always be very small. Anyway, once you have a working self-extending subfile program, you will copy it for everything else and never go for load-all again.


The Best Web Links: tips, tutorials and more.

Visit the ITKnowledge Exchange and get answers to your developing questions fast.

Ask the Experts yourself: Our application development gurus are waiting to answer your programming questions.

Dig Deeper on Integrated File System (IFS)

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.