ABL trigger definitions can be changed online. That means you can create, change, or delete ABL triggers without an exclusive schema lock.

How ABL clients handle an ABL trigger change

When an ABL trigger is changed online, all the connected ABL clients are notified of the change. This functionality is specific to ABL clients in OpenEdge 12.2.

When a trigger change is initiated, the ABL client that executes the change checks whether earlier versions of the ABL client are connected to the database. If an earlier version is found, then either the transaction terminates or is blocked until all earlier ABL clients are disconnected from the database.

Check the ABL client version

Progress recommends that you check the ABL client versions before changing ABL triggers online.

The ABL client version information is kept in the _Connect virtual system table (VST). Use one of the following methods to determine the version of an ABL client connection:
  • Run the following ABL query:
    for each _Connect where _Connect-NotifyVers < 1 
    						and _Connect-Name <> ?:: 
    						display _Connect-Name _Connect-NotifyVers.
  • Use PROMON:
    1. Launch Proenv.
    2. At the command line, type promon database and press ENTER..

      The OpenEdge monitor is displayed.

    3. Type R&D and press ENTER.

      The R&D menu is displayed.

    4. Type 1 and press ENTER.

      The status monitoring options are displayed.

    5. Type 4 and press ENTER.

      Process and client information is displayed.

    6. Type 9 and press ENTER.

      The User Notification Processes table is displayed.

    7. Review the values in the Notify Version column.

      A 1 means that the client supports online changes to triggers. A 0 means that the client does not support online changes to triggers.

    8. Close all the client connections that do not support online changes to triggers.
    9. Create, change, or delete an ABL trigger online.
      Note: You may want to set the -dbnotifytime database startup parameter to a smaller value. For example, if the parameter is currently set to the default value of 30 seconds, decrease the time. Setting the parameter to a smaller value enables clients to learn about trigger changes sooner.

How changing an ABL trigger online affects ABL clients

After the ABL client that executed a trigger change commits the change, the client notifies all the other connected ABL clients that an ABL trigger change occurred. Then, the connected ABL clients complete the database transactions that are in process. When the transactions complete, the clients refresh their cache. When the next trigger event occurs, the ABL virtual machine (AVM) applies the new trigger definition. If a trigger is deleted, the events associated with the trigger no longer occur.

Because a trigger change can affect multiple database tables and fields, an ABL client is not aware of the change until the transaction is committed.

Effect on ABL applications

You do not need to recompile ABL code that uses changed trigger definitions in order for online changes to take effect.

Effects on transactional concurrency

Changing ABL triggers online has the following effects on the concurrency of database transactions:
  • Concurrent schema changes are not allowed.
  • New database connection requests are not allowed while a trigger change is in process. These requests must be terminated or wait until the transaction completes.
  • Concurrent transactions cannot read schema data. Read operations fail or are blocked until the trigger change completes.
Methods for changing ABL triggers online
Use one of the following options to change an ABL trigger online:
  • Data Administration—Select the Add new objects on-line checkbox in the Load Data Definitions dialog box to perform the loading operation online. Use this option only to load a delta .df file when there is a difference between triggers on two databases (a source database and a target database).

    For more information, see Navigate within the Data Administration tool in Windows in Database Administration Tools.

  • ABL—Directly update the corresponding schema records and columns (which contain the trigger definitions). The AVM manages these changes internally.
    The following ABL procedure creates a new ABL trigger. The new trigger runs the create.p program whenever a record is created in the Item table:
    /* Fetches Table record id from _File System table */
    						FIND _File WHERE _File-name = 'Item'.
    						/* Creating record in _File-Trig */
    						CREATE _File-trig.
    						_File-trig._File-recid = RECID(_File).
    						_File-trig._event = 'CREATE'.
    						_File-trig._proc-name = 'create.p'.
    						_File-trig._override = YES.