ron
Member
OE 11.7.4 on Linux.
Although I've worked with Progress for a long time, I confess that my understanding of transactions and record scoping has many gaps.
I have read (and re-read) presentations from Tom and Dan -- and I still have gaps.
Here is a small test program:
> cat /tmp/test1
A)queue1 AVL:no LKD:no
A)queue2 AVL:no LKD:no
A)tally AVL:no LKD:no
B)queue1 AVL:no LKD:no
B)queue2 AVL:no LKD:no
B)tally AVL:yes LKD:no
C)queue1 AVL:no LKD:no
C)queue2 AVL:no LKD:no
C)tally AVL:yes LKD:no
I understand all of that -- except: B)tally AVL:yes LKD:no (why is the record not locked?)
I presume that the tally record being available in C)tally AVL:yes LKD:no is because the "DO TRANSACTION" only creates a weak transaction scope so that the tally record is scoped to the outer block (the procedure).
In a case like this -- what could I do to ensure that after the end of the block in the middle the transaction terminates and NO records are available?
Ron.
Although I've worked with Progress for a long time, I confess that my understanding of transactions and record scoping has many gaps.
I have read (and re-read) presentations from Tom and Dan -- and I still have gaps.
Here is a small test program:
&GLOBAL-DEFINE p PUT STREAM s UNFORMATTED
DEF STREAM s.
OUTPUT STREAM s TO "/tmp/test1".
{&p} "A)queue1 AVL:" STRING(AVAIL(queue1)) " LKD:" STRING(LOCKED(queue1)) SKIP.
{&p} "A)queue2 AVL:" STRING(AVAIL(queue2)) " LKD:" STRING(LOCKED(queue2)) SKIP.
{&p} "A)tally AVL:" STRING(AVAIL(tally)) " LKD:" STRING(LOCKED(tally)) SKIP.
DO TRANSACTION:
find first tally exclusive-lock
where t_date < DATE(1,1,2023).
{&p} "B)queue1 AVL:" STRING(AVAIL(queue1)) " LKD:" STRING(LOCKED(queue1)) SKIP.
{&p} "B)queue2 AVL:" STRING(AVAIL(queue2)) " LKD:" STRING(LOCKED(queue2)) SKIP.
{&p} "B)tally AVL:" STRING(AVAIL(tally)) " LKD:" STRING(LOCKED(tally)) SKIP.
END.
{&p} "C)queue1 AVL:" STRING(AVAIL(queue1)) " LKD:" STRING(LOCKED(queue1)) SKIP.
{&p} "C)queue2 AVL:" STRING(AVAIL(queue2)) " LKD:" STRING(LOCKED(queue2)) SKIP.
{&p} "C)tally AVL:" STRING(AVAIL(tally)) " LKD:" STRING(LOCKED(tally)) SKIP.
> cat /tmp/test1
A)queue1 AVL:no LKD:no
A)queue2 AVL:no LKD:no
A)tally AVL:no LKD:no
B)queue1 AVL:no LKD:no
B)queue2 AVL:no LKD:no
B)tally AVL:yes LKD:no
C)queue1 AVL:no LKD:no
C)queue2 AVL:no LKD:no
C)tally AVL:yes LKD:no
I understand all of that -- except: B)tally AVL:yes LKD:no (why is the record not locked?)
I presume that the tally record being available in C)tally AVL:yes LKD:no is because the "DO TRANSACTION" only creates a weak transaction scope so that the tally record is scoped to the outer block (the procedure).
In a case like this -- what could I do to ensure that after the end of the block in the middle the transaction terminates and NO records are available?
Ron.