• 1 reply
  • Latest Post - ‏2014-08-28T00:08:54Z by george.baker
344 Posts

Pinned topic Pooling: SignOn failure

‏2014-08-11T17:05:36Z |

I have a project that is to result in Web services.  It uses a connection pool that uses single use IDs.  If an error should occur for some unpredictable reason HATS will terminate the session.  When this occurs, does HATS run the Disconnect macro before terminating the session?  

If it does not run that macro the host session will simply disconnect leaving the host to deal with an idle session timeout in order to release that user ID for reuse.  HATS will then place the user ID back in the queue to be reused.  If HATS needs to start another session and selects that same user ID, all before the host logs the user off of the prior  terminal the HATS Connect macro will either fail or detect an error.  In my project I will detect an error because the host will tell me that the user is currently logged onto another terminal.  I could then return to the main logon screen.  However, If I exit the connect macro normally, then the terminal session is not in the expected state and the ensuing macro will fail because it does not see its Start screen.  To resolve that issue I would need to place code in every macro to recognize that state and return an error to the client telling them to reissue the request.  

In the case were the Disconnect macro is run, I'm covered as my macro will run under any condition the host will throw and properly terminate the session.  However, I'm looking for a cleaner way to handle this condition if the Disconnect macro is not run.   I don't want to get into a condition where the connection fails, the ID is placed back into the queue only to be immediately reused and the condition repeat.  Is there a way to exit the macro and tell HATS that the user ID is temporarily unavailable and to select a different user ID from the pool, or place the request back into the pending queue to wait for another connection to free up?

  • george.baker
    344 Posts

    Re: Pooling: SignOn failure


    Via testing I've determined that HATS does not run the disconnect macro when the macro fails.

    In this case I'm lucky in that I am give the opportunity to "steal" the session from the other terminal and continue.  This is OK since the only way this can occur is if there was a macro failure.