Hi,
To my understanding, if a record is being updated with an exclusive-lock, the record lock will not be released until either the transaction or the record buffer is out of scope the last.
Looking at the following two listing files, both customer buffers are scoped to the entire procedure. After the "waiting" message poped up, I ran another prowin32 session and tried to update the same customer, only testing2.p still had the record being locked. In testing.p, the lock was released after the internal procedure finished.
This is confusing me, can anyone clarify please?
Thanks
c:\temp\testing.p 08/08/2011 16:35:12 PROGRESS(R) Page 1
{} Line Blk
-- ---- ---
1 RUN updcust.
2 MESSAGE "Waiting...." VIEW-AS ALERT-BOX.
3
4 PROCEDURE updcust:
5 FIND customer WHERE custnum = 1 EXCLUSIVE-LOCK.
6 customer.comments = "testing".
7 END.
c:\temp\testing.p 08/08/2011 16:35:12 PROGRESS(R) Page 2
File Name Line Blk. Type Tran Blk. Label
-------------------- ---- ----------- ---- --------------------------------
c:\temp\testing.p 4 Procedure Yes Procedure updcust
c:\temp\testing.p 0 Procedure No
Buffers: sports2000.Customer
c:\temp\testing2.p 08/08/2011 16:45:10 PROGRESS(R) Page 1
{} Line Blk
-- ---- ---
1 1 DO TRANSACTION:
2 1 FIND customer WHERE custnum = 1 EXCLUSIVE-LOCK.
3 1 customer.comments = "testing".
4 END.
5
6 MESSAGE "Waiting...." VIEW-AS ALERT-BOX.
7
8
c:\temp\testing2.p 08/08/2011 16:45:10 PROGRESS(R) Page 2
File Name Line Blk. Type Tran Blk. Label
-------------------- ---- ----------- ---- --------------------------------
c:\temp\testing2.p 0 Procedure No
Buffers: sports2000.Customer
c:\temp\testing2.p 1 Do Yes
To my understanding, if a record is being updated with an exclusive-lock, the record lock will not be released until either the transaction or the record buffer is out of scope the last.
Looking at the following two listing files, both customer buffers are scoped to the entire procedure. After the "waiting" message poped up, I ran another prowin32 session and tried to update the same customer, only testing2.p still had the record being locked. In testing.p, the lock was released after the internal procedure finished.
This is confusing me, can anyone clarify please?
Thanks
c:\temp\testing.p 08/08/2011 16:35:12 PROGRESS(R) Page 1
{} Line Blk
-- ---- ---
1 RUN updcust.
2 MESSAGE "Waiting...." VIEW-AS ALERT-BOX.
3
4 PROCEDURE updcust:
5 FIND customer WHERE custnum = 1 EXCLUSIVE-LOCK.
6 customer.comments = "testing".
7 END.
c:\temp\testing.p 08/08/2011 16:35:12 PROGRESS(R) Page 2
File Name Line Blk. Type Tran Blk. Label
-------------------- ---- ----------- ---- --------------------------------
c:\temp\testing.p 4 Procedure Yes Procedure updcust
c:\temp\testing.p 0 Procedure No
Buffers: sports2000.Customer
c:\temp\testing2.p 08/08/2011 16:45:10 PROGRESS(R) Page 1
{} Line Blk
-- ---- ---
1 1 DO TRANSACTION:
2 1 FIND customer WHERE custnum = 1 EXCLUSIVE-LOCK.
3 1 customer.comments = "testing".
4 END.
5
6 MESSAGE "Waiting...." VIEW-AS ALERT-BOX.
7
8
c:\temp\testing2.p 08/08/2011 16:45:10 PROGRESS(R) Page 2
File Name Line Blk. Type Tran Blk. Label
-------------------- ---- ----------- ---- --------------------------------
c:\temp\testing2.p 0 Procedure No
Buffers: sports2000.Customer
c:\temp\testing2.p 1 Do Yes