issue #19456: ported fix for record locking and refresh