ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Canceling Interactive Programs

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

  • Canceling Interactive Programs

    SO I have a similar post form way back when. However that solution will not work.. So I thought I would see if anyone else has an idea.
    A user sits in a program for 10 minutes. I know this b/c we write out to a file with a timestamp and user id with a bunch of other goodies I would need to end the job. I can do that but do not want to end the job where they need to sign on again.
    So my question is can I cancel a program by retrieving the call stack ( which I don't really need b/c I know the program name ) and just end that program?
    Anyone know of an API or anything that does this?
    So I could then just call the API with parms to whack them out of the program?

    Ideas?

  • #2
    Let me add to this. They could be in this program for 8 hours just with different options or in this case truck numbers. I know how long they have been in the "truck" So after 10 minutes I need to end or close that program only and not the session.

    Comment


    • #3
      Why not just have the DSPF time-out after so long?

      Comment


      • #4
        That would be great but thats a timer that is not reset when the user may be typing.

        Comment


        • #5
          Perhaps you could share _why_ you want to do this. What problem are you trying to fix? DIfficult to come up with a real set of solutions when we don't know what the end game is.

          Comment


          • #6
            Sorry I thought it was easy to understand. These programs are maintenance programs. So when someone stays in it someone else cannot update these set of records.

            Comment


            • #7
              Originally posted by CaptainRon View Post
              That would be great but thats a timer that is not reset when the user may be typing.
              True, but how would that be different that some other process ending the program after 10 minutes?

              Comment


              • #8
                Originally posted by CaptainRon View Post
                That would be great but thats a timer that is not reset when the user may be typing.
                When the dspf times out display a window requiring them to enter "Y' or press an FKey to continue (whatever). If that isn't replied to within 15 or 30 seconds then end.

                Comment


                • #9
                  I don't know how much re-writing you can do with these maint programs, but maybe you could redesign them so they only lock the record at the moment of update? The last place I worked at did the following as standard:
                  • All database files include fields last changed by user/date/time that is updated every time someone changes the record
                  • When editing a record, the record is read without lock to display on the maint screen. The last changed by user/date/time from the record is remembered
                  • When the user saves their changes, the record is read with lock. The current values of last changed by user/date/time are compared with the previous values
                  • If they are the same, then no-one else has changed the record while you were editing and the edit is allowed - the record is updated with the user input and an updated last changed by user/date/time
                  • Otherwise the edit is disallowed with a "concurrent maintenance" error message (or this is just a warning the user can choose to ignore)

                  Comment


                  • #10
                    The maintenance program should be rewritten. However that is one of the most nasty programs we got..lol It does kind of do the update check now.. It still allows a user in the maintenance program just not do anything b/c of so many files that are opened to the first user. The display thing won't work i don't think b/c you cannot refresh it if they type an option or something and still stay in it. It has many updates it could do during the same session or record. If I can do a refresh and update the display timer I could probably get that to work. But just having a default time and not being able to update it just won't work for this program. The best thing would be to end the program based on "something" and not end the job. So if I could pass something to the users thread to end just the program, that would be the ultimate. I know how long they have been in the program so that's not a problem. Its ending the program and not the session I'm having issues with. I would think there has to be a solution. Even overiding the display file and changing the minutes would work but I cannot get that to refresh in an overide nicely...
                    Hope all that made sense....

                    Comment

                    Working...
                    X