|
Bruce Collins wrote:
1) Program A has a record Lock on record 1 of filea.2) Program B tries to get a lock on Record 1 of filea but fails.Since Program B failed I want to retrieve what statement number in Program A that caused the Lock Condition so I can track down where I need fix the code to handle locked conditions. Does this make sense? Thanks
Bruce,This sounds like an on-line maintenance program that has the lock. I surmise that because normally a batch program will vacate the lock long before the time-out occurs (though not always). I have users bring up Customer Master records all the time under the maintenance program - and then go to lunch (both literally and figuratively).
The best solution for that kind of scenario is to:
* Retrieve the record without a lock
* Store the current ("Before") image of the record
o Or just the fields if you update by fields rather than the
whole format or record
* When the user enters their changes, retrieve the record for update
* Test to see if the record image (or fields) still matches the
original image
* If so, update the record / fields
* If not, send them a message ("You took too bloody long") and go
back to step #1.
I had to modify about a dozen major file maintenance programs to
accomplish this but, once I did, support calls dropped significantly.
* Jerry C. Adams
*IBM System i Programmer/Analyst
B&W Wholesale Distributors, Inc.* *
voice
615.995.7024
fax
615.995.1201
email
jerry@xxxxxxxxxxxxxxx <mailto:jerry@xxxxxxxxxxxxxxx>
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.