|
You can have both applications updating the file, but only one program can update a record at a time. You can try changing the lock wait time on the posting program to *nomax or something shorter than forever but long enough for the user to complete their update. The other way is to read the record in the maintenance program with no lock, save the original image in a data structure, have the user make their changes, then after all edits are passed, read the record with a lock and see if anything has changed from the original saved image and if not changes, update the file. This way the lock is only for a second under program control and not locked while the user is making changes or home for the evening. I have a sample somewhere that I can share showing how to code a simple file update. Christopher Bipes Information Services Director CrossCheck, Inc. -----Original Message----- From: midrange-l-bounces+chris.bipes=cross-check.com@xxxxxxxxxxxx [mailto:midrange-l-bounces+chris.bipes=cross-check.com@xxxxxxxxxxxx] On Behalf Of Pete Helgren Sent: Monday, October 23, 2006 8:49 PM To: Midrange Systems Technical Discussion Subject: A question about record locks I have a couple of applications that are experiencing conflicts on record locking and I am not sure what to look for. App 1 is a maintenance application on the file. The CLLE program that calls the app has the following OVRBDF statement in it: OVRDBF FILE(MYFILE1) MBR(&MBR) RCDFMTLCK((FMTFILE1 + *SHRUPD)) OVRSCOPE(*JOB) When I run the program and use the WRKOBJLCK command I see the following: Job User Lock Status Scope QPADEV0005 PETE *SHRRD HELD *JOB Details show: Object Member Object Library Type Lock Status Locks MYFILE1 MYLIB *FILE-PHY *SHRRD HELD YES The member locks show the following detail: Member Lock Type Lock Status Share Scope MYMBR MBR *SHRRD HELD *JOB DATA *SHRRD HELD *JOB DATA *SHRUPD HELD *JOB Records are retrieved in the RPG program with a CHAIN(N) App 2 is a posting application that posts data from MYFILE1 into another file. CL looks like: OVRDBF FILE(MYFILE1) MBR(&CMBR) RCDFMTLCK((FMTFILE1 + *SHRUPD)) OVRSCOPE(*JOB) Records are retrieved in the RPG program using READ. In both RPG programs the F spec is: FMYFILE1 UF A E K DISK I get the following error (RNQ1218) when I run the posting program and someone is in the maintenance program with a record retrieved: Unable to allocate a record in file MYFILE1 (R C G D F). Where am I missing the boat? I thought the OVRDBF would allow the file to be read and updated by both programs. Am I wrong about that?
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.