FIND CURRENT statement and db activity

Posted by George Potemkin on 20-Sep-2016 13:33

Progress 11.6

do transaction:
  find first customer SHARE-LOCK.
  message "Lock status: S, Starting point" view-as alert-box info.

  find current customer NO-LOCK.
  message "Lock status: S L, no db activity" view-as alert-box info.

  find current customer SHARE-LOCK.
  message "Lock status: S, Latch lock: LKT, Db access: 2" view-as alert-box info.

  find current customer EXCLUSIVE-LOCK.
  message "Lock status: X U, Latch lock: LKT, Db Access: 0" view-as alert-box info.

  find current customer NO-LOCK.
  message "Lock status: X UL, no db activity" view-as alert-box info.

  find current customer SHARE-LOCK.
  message "Lock status: X, Latch lock: LKT, Db access: 1" view-as alert-box info.
end.


The code above updates the record lock as expected (see "Lock status")..

FIND CURRENT statement does not need to lock any latches because a client's session knows an address of lock entry of the record in the current table's buffer. That is why two statements above work "silently" with db shared memory ("no db activity").
The record stays locked after all these statements. It can't be updated by other sessions. So all statements do not need to re-read the record.
 
Why FIND CURRENT SHARE-LOCK statements re-read the record? And first statement does this twice!
Why they lock LKT (lock table hash chain) latch?
They lock the LKT latch but they do not scan the hash chain! What they are doing then? Don't ask me how I know this. I will give an answer at EMEA PUG Challenge. ;-)
 
Regards,
George

All Replies

Posted by Dmitri Levin on 07-Oct-2016 12:16

George

How about those of us who did not make it to EMEA PUG Challenge this year? Will we get an answer :)

Posted by gus bjorklund on 07-Oct-2016 14:18

Hello, Dmitri.

I’m sorry, but i forgot the question

Posted by George Potemkin on 07-Oct-2016 16:22

> How about those of us who did not make it to EMEA PUG Challenge this year?

Valeriy Bashkatov seemed to post to the internet everything that happened during the conference. No secrets anymore! ;-)

> Will we get an answer

I don't have an answer either. ;-( In /average/ (in long loop) db activity of changing the record lock flags matches the expectations. But I don't have an explanation for the activity created by the code in the starting post.

This thread is closed