Repeat and Do blocks- Transaction

anandknr

Member
Hi All,

The main difference b/w Repeat and Do block is Repeat by default have transaction property.

D:\WRK\prog\test.p 02/20/2010 00:13:36 PROGRESS(R) Page 1


{} Line Blk
-- ---- ---
1 1 do :
2 1 find first customer .
3 end .
4
5 1 repeat :
6 1 find first customer .
7 end .
8
9 1 do :
10 1 find first customer .
11 end .
12
13 1 repeat :
14 1 find first customer .
14 end .
D:\WRK\prog\test.p 02/20/2010 00:13:36 PROGRESS(R) Page 2


File Name Line Blk. Type Tran Blk. Label
-------------------- ---- ----------- ---- --------------------------------
D:\WRK\prog\test.p 0 Procedure No
Buffers: sports.Customer


D:\WRK\prog\test.p 1 Do No
D:\WRK\prog\test.p 5 Repeat No
D:\WRK\prog\test.p 9 Do No
D:\WRK\prog\test.p 13 Repeat No




But why the listing file shows Tran property NO for both Do and Repeat block.
 

RealHeavyDude

Well-Known Member
To be precise: Every statement that changes the database or causes an exclusive lock will invoke a transaction - in your case the update. The transaction scope is then extended to the next outer block with transaction capabilities - in your case the repeat. Note: If you replace the repeat with do ( a do block per default does not have transaction capabilities ) the transaction will be extended to the procedure itself ( the next outer block ... ).

Heavy Regards, RealHeavyDude.
 
Top