×
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.
Matt,
This happens because (stupid) RPG locks each record when read from an update-capable file, until either another record is read, or you do the corresponding UPDATE or DELETE of that record. This is called "Record locks".
There are several well-known techniques -- called "lock-free" processing, where you change the logic to issue the READ without a lock, into a data structure, then you present the screen to the user, let them make any changes, and when they press Enter, you then you re-read the record again, this time with a record lock, into another data structure, and you compare the old DS to the new DS to detect if anyone else changed that record in the meantime. If no other changes are detected, you go ahead and issue the UPDATE or DELETE. Otherwise, you give the user a message like:
Sorry, someone else has updated that record, please try again ...
and some F-key to let them re-try.
See:
https://www.mcpressonline.com/programming/rpg/avoid-record-lock-errors
and
https://www.mcpressonline.com/programming/rpg/techtip-preventing-record-lock-part-1
and
https://www.mcpressonline.com/programming/rpg/techtip-preventing-record-lock-part-2
Or, convert the RPG update programs to use embedded SQL to update only the columns (fields) changed by the user.
Hope that helps,
Mark S. Waterbury
On Friday, June 28, 2019, 12:42:21 PM EDT, Matt Olson <Matt.Olson@xxxxxxxx> wrote:
Is there a deadlock monitoring system built into DB2 like there is in SQL Server?
If so how do you enable it or view it?
We are finding some RPG programs that are maintaining exclusive locks on files for as long as you are in the screen, which then causes our end users of our website to not be able to login as the web program can't read their record. This exhibits itself in an not very helpful message of "[57014] [IBM][AS] Resource error - SQLSTATE 57014, SQLCODE -1044."
We have already fixed one RPG program which has helped the situation, but there appears to be more RPG screens doing this.
I'm wondering what the best strategy is for finding these RPG programs as the locks are released when they close out and we might not be able to do a WRKOBJLCK command in time on the four potential files that are typically required to login.
As an Amazon Associate we earn from qualifying purchases.