Progress/400
Product Guide


How Progress/400 Maintains Word Indexes

Progress/400 word indexes are maintained by a Progress-supplied trigger program and the Progress-supplied Word Index Support Processor. When you create a word index for a physical file, triggers are added to the file using the OS/400 ADDPFTRG (Add Physical File Trigger) command. The Progress PROWISTRG program then becomes the trigger program for after-insert, after-delete, and after-update events. This ensures the maintenance of any Progress/400 word indexes defined for a physical file whenever the file is changed. DB2/400 triggers are used because they greatly minimize the impact on your existing AS/400 applications. DB2/400 triggers provide a method that Progress uses to “hook” into your file updates.

DB2/400 triggers are fired before or after a record is created, updated, or deleted. This allows the Progress/400 trigger program to be called whenever a word index update is required. Triggers are not fired when a transaction is rolled back using any OS/400 ROLLBACK operation or the Progress UNDO statement; however, Progress handles all ROLLBACKs properly. The process used to maintain Progress/400 word indexes depends on whether commitment control is in effect:

NOTE: If the trigger program detects that commitment control is active but the Word Index Support Processor is not running, the trigger program sends an escape message to the application program indicating that the trigger program failed. If your application does not handle this escape message properly, your application might fail. If your application uses commitment control, files that are opened under commitment control cannot be updated if the Word Index Support Processor is not running.

The Word Index Support Processor

The Progress/400 Word Index Support Processor updates Progress/400 word indexes if the physical file is opened for update with commitment control active. The Word Index Support Processor consists of two perpetual jobs that are started using the Progress-supplied STRWISPRC utility. (For details, see its description in AS/400 Utilities.") Once these jobs are running, they process all transaction COMMITs that your application performs that affect DB2/400 files with Progress/400 word indexes built over them:

These jobs use a Progress/400 library called the Word Index Work Library.

NOTE: If the AS/400 crashes, you might not be able to restart the word index processor. If this occurs, call Progress Technical Support.

The Word Index Work Library

The Word Index Work Library is created when Progress/400 is installed on your AS/400. You are prompted for a library name (the default is PROWISWRK), then the install process creates the named library and places into it the objects required by the Word Index Support Processor.

NOTE: Do not rename, delete, move, or change these objects in any way or word indexing will not work.

The objects in the Word Index Work Library include the following:

These objects are static and are always in the Work Library. In addition, some dynamic objects are placed in this library while the Word Index Support Processor is running.

Multiple installations of Progress/400 can share the Word Index Work Library.

Preventing Word Index Corruption

Certain OS/400 commands will corrupt a Progress/400 word index or cause Progress/400 word indexing not to function when they are run against:

If you run these commands, you must follow specific recovery procedures to fix the problems that they cause. Table 2–8 documents the commands, the resulting problems, and the recovery procedures.

Table 2–8: Word Index Corruption Recovery Procedures
OS/400 Command
Problem
Recovery Procedure
RGZPFM
Can change the relative record number of a record.
Run the Progress/400 GENWRDIDX utility to generate the word indexes of any affected file.
APYJRNCHG
Can change a file’s records without firing the file’s triggers.
Run the Progress/400 GENWRDIDX utility to generate the word indexes of any affected file.
RMVJRNCHG
Can change a file’s records without firing the file’s triggers.
Run the Progress/400 GENWRDIDX utility to generate the word indexes of any affected file.
RMVPFTRG
Removes the trigger program required by Progress/400.
Using the Progress/400 Data Dictionary, delete the word indexes of the affected file, COMMIT, then re-create the word indexes.
ADDPFTRG
Changes the trigger program required by Progress/400.
Using the Progress/400 Data Dictionary, delete the word indexes of the affected file, COMMIT, then re-create the word indexes.
RSTOBJ or RSTLIB to restore a physical file.
Can change a file’s records without firing the file’s triggers.
Run the Progress/400 GENWRDIDX utility to generate the word indexes of any affected file.
RSTLIB to restore the Progress/400 Product Library into a different library.
Because the original library no longer exists, the trigger program is not found when a file with word indexes built over it is opened.
Add the new Progress/400 Product Library to your library list, then run the UPDWISTRG utility to change trigger programs for any files in that library that have word indexes built over them.

For descriptions of the utilities noted in the recovery procedures, see AS/400 Utilities."


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095