ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

error subfile bringing in "RECORD IN USE BY JOB - CPF5027"

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • error subfile bringing in "RECORD IN USE BY JOB - CPF5027"

    Hello,

    I'm using an error subfile to display screen errors, in a order entry system. I'm using the QMHSNDPM api and QMHRMVPM to send error messages to the subfile and clear the subfile, respectively. However, I have a situation where a screen error message was sent to the error subfile and then I chain to a file and receive record lock (on the chained to file), the "record in use by job" is also being loaded to the error subfile (not sure how this happens) and then the first error loaded and also the "record in use by job" message both display. Just wondering if there's a way to exclude the "record in use by job" message (or any other non screen related errors) from displaying in the error subfile.

    Any ideas would be appreciated.

    Thank you.

  • #2
    Re: error subfile bringing in "RECORD IN USE BY JOB - CPF5027"

    One obvious solution is not allowing the message to be sent in the first place. Fix the logic that causes the error. If for some reason that can't be done, remove the message from the message queue that's populating the message subfile before writing the control record.
    Tom

    There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors.

    Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth?

    Comment


    • #3
      Re: error subfile bringing in "RECORD IN USE BY JOB - CPF5027"

      The important thing to understand is that when you create your error message subfile, you tell it which message queue to display. Then, any/all messages that go to that message queue will be shown...

      So if you understand that, you'll understand that there are various solutions:

      a) Fix the logic so you don't get the message (as Tom said)
      b) Have the error subfile listen to a different message queue
      c) Have the database logic send it's messages to a different queue
      d) Remove all messages from the queue before displaying the screen.

      Any of these will work... it's quite simple, it's going to show everything on the queue, so either have the database errors go somewhere different froom what you're displaying, or eliminate the error, or whatever. Every call-stack entry (program or procedure) gets it's own queue, so simply putting your database logic in a subprocedure would move that logic to a different queue.

      Haviing said that... I'm having a hard time understanding why you don't want this message. If the user can't access a record because it's in use by another job, isn't it a GOOD thing that the user is notified of this?

      Comment

      Working...
      X