Feedback
Did this article resolve your question/issue?

   

Article

What is the Record locking table _UserLock

« Go Back

Information

 
TitleWhat is the Record locking table _UserLock
URL NameP89299
Article Number000166193
EnvironmentProduct: Progress
Version: 8.x, 9.x
Product: OpenEdge
Version: 10.x, 11.x
OS: All supported platforms
Other: _UserLock
Question/Problem Description
What is the Record locking table _UserLock 
What is the advantage of using _UserLock instead of _Lock
How to avoid Error 3307 when displaying an entire record from the VST _UserLock
Steps to Reproduce
Clarifying Information
Error Message
Defect/Enhancement Number
Cause
Resolution
_Userlock VST:
  • The _UserLock result set is much smaller than a _Lock query because it limits the number of locks per user instead of a scan of the entire lock table.
  • _UserLock reports the first 512 lock entries for a particular user with "one request" to the lock subsystem
  • _UserLock provides a snapshot per user per _user-lock record and not a changing picture as each _lock is per lock.
  • The following restriction applies: if a single user has more than 512 locks, they will be missing in the _userlock array.
11.6.0 (Enhancement PSC00329196)_UserLock VST:
  • In previous versions, the _UserLock VST reports the first 512 lock entries for a particular user
  • The total number of locks held by this user and the lock type break down was included which makes it easier to identify which user or users are using excessive resources on the system.
  • The following fields were added to _UserLock to provide the same information as:
PROMON > R&D > 3. Other Displays > 7. Total Locks per User 
 
​_UserLock-Total, _UserLock-Total-Record, _UserLock-Total-Table, _UserLock-Total-Purge, _UserLock-Total-RecGet, _UserLock-Total-Partition, _UserLock-Total-SHR, _UserLock-Total-EXCL, _UserLock-Total-IS, _UserLock-Total-SIX, _UserLock-Total-IX
  • The _UserLock VST was also enhanced to be updated the same way the _lock vst avoids latching on the _LKT latch while traversing the lock table to avoid contention with the rest of the production environment.  This will improve performance of the _UserLock query while avoiding the impact on the rest of the system. 
Below is a sample program that could be used to display the information in the _UserLock table. It is not the only way to display the information in this table. This example:
  • Lists users that have 500 locks held
  • Prevents the _UserLock arrays with 512 elements from fitting on the screen which would otherwise result in error 3307:
<segment-name> has exceeded its limit of <segment-size> bytes, in <file-name> at line # <line-number>. (3307)
 
DEFINE FRAME z WITH WIDTH-CHARS 120 12 DOWN.

FOR EACH _UserLock WHERE _UserLock-Usr <> ? AND
	_UserLock-Type[500] <> ? NO-LOCK:

FIND _Connect WHERE _Connect._Connect-usr = _UserLock._UserLock-Usr
	NO-LOCK NO-ERROR.
       
IF _UserLock._UserLock-Chain[500] <> ? OR
	_UserLock._UserLock-Flags[500] <> ? OR
	_UserLock._UserLock-Recid[500] <> ? OR
	_UserLock._UserLock-Type[500] <> ? 
	THEN DO:

DISPLAY
	_UserLock._UserLock-Chain[500] FORMAT ">>>9"
	_UserLock._UserLock-Flags[500] FORMAT "X(5)"
	_UserLock._UserLock-Recid[500] FORMAT ">>>>>>>>>>>>>>>9   "
	_UserLock._UserLock-Type[500] FORMAT "X(5)"
	_UserLock._UserLock-Usr     FORMAT ">>>9"
	_UserLock._UserLock-Name
	SUBSTRING( _Connect._Connect-Device,6) WHEN AVAILABLE _connect WITH FRAME Z.

DOWN WITH FRAME Z.
END.
END.

 
Workaround
Notes
References to Written Documentation:

OpenEdge Data Management: Database Administration, Virtual System Tables, Record locking table (_UserLock)
Last Modified Date4/21/2017 1:08 PM
Attachment 
Files
Disclaimer The origins of the information on this site may be internal or external to Progress Software Corporation (“Progress”). Progress Software Corporation makes all reasonable efforts to verify this information. However, the information provided is for your information only. Progress Software Corporation makes no explicit or implied claims to the validity of this information.

Any sample code provided on this site is not supported under any Progress support program or service. The sample code is provided on an "AS IS" basis. Progress makes no warranties, express or implied, and disclaims all implied warranties including, without limitation, the implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample code is borne by the user. In no event shall Progress, its employees, or anyone else involved in the creation, production, or delivery of the code be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample code, even if Progress has been advised of the possibility of such damages.