WebSpeed
Developer’s Guide


Subprocedures

If you start a database transaction in a main procedure, that transaction remains active even while the main procedure runs called procedures. In Figure 9–6, p-txn11.p runs p-txn11a.p within a database transaction.

Figure 9–6: DB Transactions and Subprocedures

The REPEAT block p-txn11.p procedure is the transaction block for that procedure: it contains a direct update to the database. The database transaction begins at the start of each iteration of the REPEAT block and ends at the end of each iteration. That means when the p-txn11.p procedure calls the p-txn11a.p procedure, the transaction is still active. So all the work done in the p-txn11a.p subroutine is part of the transaction started by the main procedure, p-txn11.p.

If a system error occurs while you are processing orders for a customer, WebSpeed undoes all the order processing work you have done for that customer, as well as any changes you made to the customer record itself.


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