Question

  Asked: Jan 13 2005   1:25 PM GMT
  Asked by: mygoodname


Determining Object Lock Status


OS/400, iSeries, i5

One of our applications obtains exclusive locks on user-specific data areas.

The application is being changed to use shared read locks instead.

The problem is that a separate application was reading through a list of these data areas and counting which ones it was unable to obtain its own exclusive lock for in order to count the number of users on the application.

WRKOBJLCK only outputs to paper (and I don't want to start working with temporary spool files) and I can't seem to find an API that will give me a list of objects and lock states.

Did I miss one or will have to use WRKOBJLCK (ugly but doable)?

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0



Kludgy perhaps but could your application try to obtain the lock itself and monitor for a failure message, output to a file at that time?
  • AddThis Social Bookmark Button

Browse more Questions and Answers on AS/400.

Looking for relevant AS/400 Whitepapers? Visit the Search400.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register

TheQuigs  |   Jan 17 2005  1:16PM GMT

Here’s an API (from the Information Center):

List Object Locks (QWCLOBJL) generates a list of locks for an object or database file member. An object-level or member-level lock may be specified.

 

pcurtis  |   Jan 18 2005  3:25PM GMT

WRKOBJLCK is used to determine what is locking an object. Using * in the output parameter will display the lock on screen.