Progress
Programming
Handbook
Transactions and Subprocedures
If you start a transaction in a main procedure, that transaction remains active even while the main procedure runs called procedures. For example,
p-txn11.p
runsp-txn11a.p
within a transaction:
This procedure lets you update customer information and then asks if you want to process the customer’s orders. If you say yes, the procedure runs a second procedure called
p-txn11a.p
.
The REPEAT block
in the p-txn11.p
procedure is the transaction block for that procedure: it contains a direct update to the database. The transaction begins at the start of each iteration of the REPEAT block and ends at the end of each iteration. That means that, when thep-txn11.p
procedure calls thep-txn11a.p
procedure, the transaction is still active. So all the work done in thep-txn11a.p
subroutine is part of the transaction started by the main procedure,p-txn11.p.
The following figure, illustrates the start and end of the full transaction.Figure 12–3: The Transaction Block for the p-txn11.p Procedure
![]()
If a system error occurs while you are processing orders for a customer, Progress 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 |