Progress
Programming
Handbook


Determining When Transactions Are Active

You can use the TRANSACTION function to determine whether a transaction is active in a procedure. The TRANSACTION function can help you identify the transaction and subtransaction blocks within a procedure.

Run p-nord2.p to see how the TRANSACTION function works:

p-nord2.p
MESSAGE "A transaction" (IF TRANSACTION THEN "is" ELSE "is not") 
        "active before the REPEAT block.". 
ordblock: 
REPEAT: 
  MESSAGE "A transaction" (IF TRANSACTION THEN "is" ELSE "is not") 
        "active in the outer REPEAT block.". 
  CREATE order. 
  UPDATE order-num cust-num odate. 
  olblock: 
  REPEAT: 
    MESSAGE "A transaction" (IF TRANSACTION THEN "is" ELSE "is not") 
        "active in the inner REPEAT block.". 
    CREATE order-line. 
    order-line.order-num = order.order-num. 
    SET line-num qty item-num price. 
  END. 
END. 

This procedure displays messages telling you whether a transaction is active or inactive in three places. You can get more information on transaction activity by using the LISTING option on the COMPILE statement. See the Progress Language Reference for more information on the COMPILE statement and the TRANSACTION function.


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