× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



http://systeminetwork.com/article/command-handle-object-and-record-locks-prcobjlck

But what happens if it's a batch job or a QZDASOINIT job servicing
ODBC/JDBC requests? Hope they use commitment control so you don't
create an even bigger mess!

Just killing the job might have been ok 6 years ago...but times have changed.

Locks are usually a result of one of the following:
1) Poor programming, program reads a record with a lock, displays a
screen; the record remains locked till the user presses enter.
2) A "pseudo-closed" cursor kept open by the system

Solutions:
1) Fix the program, read without lock, display the record, after the
user presses enter, read with lock, compare to see if the record was
changed by somebody else, then update.
2) Use SQL to delete all records OR try ALCOBJ OBJ((MYFILE *FILE
*EXCL)) CONFLICT(*RQSRLS) before doing the CLRPFM.

HTH,
Charles

On Fri, Jul 1, 2011 at 1:22 PM, Shaheen Ahmed
<Syed.Ahmed@xxxxxxxxxxxxxxx> wrote:
Do somebody have a solution for the following.

In a CLP program I got an error when executing CLRPFM MyLib/MyFile
command. This is due to the file lock by the user. I need to send a
message to the users who is locking this file. The CLP program should
keep retrying this command for 5 times then kill the job of the users if
they don't release the lock.

Thanks


--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.