SBS-CASE Tools™ contains instructions that allow the programmer to communicate with SBS-Pathfinder™ resources. In a perfect world, each time a conversation between the TIP Driver and SBS-Pathfinder™ takes place, it occurs in under a second. Since this isn’t a perfect world, we know that delays can occur. Maybe anti-virus happens to be scanning and has taken control over the resource, or maybe the resource is down or … You get the picture. The products try to take this into consideration by the use of time outs. This document focuses on the use of those time outs.
SBS-CASE Tools™
When inserting an execute transaction instruction into your subroutine the product will default to a terminal time out of 5 seconds and SBS-Pathfinder timeout of 0 seconds. It will also not turn on the Queue Transmission option.
Terminal Timeout
The terminal timeout is specified in seconds. It is a number in the range of 5 to 120 seconds inclusive. This number represents the number of seconds that the device that the TIP Driver [HHT] is running on, will wait for the expected results to be returned from Pathfinder. After that number is reached or exceeded, the HHT will no longer be in a mode to receive the result. The HHT will time out and your program will set the corresponding error code in the system variable “System.ErrorNumber”. Please be sure to check for errors after inserting an execute transaction into your subroutine.
SBS_Pathfinder Timeout
The SBS-Pathfinder™ timeout is specified in seconds. It is a number in the range of 0 to 120 seconds inclusive. This number represents the maximum number of seconds that the SBS-Pathfinder™ Resource will allow to transpire before starting to process the received request. If this number is exceeded, the resource will ignore the request and will NEVER process that request. An entry of 0 means (no time out) that the resource will always process the request, regardless of how much time has elapsed.
Programming TIPS
The terminal timeout should be set for 2 seconds more than the SBS-Pathfinder™ timeout. For example, if you have a call to a stored procedure (single result) that can run for an extended period of time, you may want to set the terminal timeout to 10 and the SBS-Pathfinder™ to 8.
The above time outs would yield the following;
- HHT sends a single result request to SBS-Pathfinder™
- SBS-Pathfinder™ receives the request and drops it in a Q and acks back to the device it received it.
- The ODBC resource reads it from the Q
- The resource formats it and sends it to the ODBC driver
- The ODBC driver performs the necessary work and sends the results back to the ODBC resource (success or failure)
- SBS-Pathfinder™ then sends that info back to the terminal
If SBS-Pathfinder™ doesn’t do all the above steps successfully, then the transaction failed.
An example using the above time outs follows;
- HHT sends a single result request to SBS-Pathfinder™ at 10:00:00
- SBS-Pathfinder™ receives the request and drops it in a Q and acks back to the device it received it at 10:00:01.
- The ODBC resource reads it from the Q at 10:00:01. It will run the transaction because the elapsed time is not in excess of 10:00:08
- The resource formats it and sends it to the ODBC driver at 10:00:01
- The ODBC driver performs the necessary work and sends the results back to the ODBC resource (success or failure) at 10:00:04
- SBS-Pathfinder™ then sends that info back to the HHT which receives it at 10:00:05. It would have not received it if the time was after 10:00:10.
SBS-Pathfinder™ Resource Configuration
The SBS-Pathfinder™ resource also has its set of time outs that can be configured. The following screen shot shows the default settings for an ODBC resource.
The “Max Execution Timeout” is the maximum amount of time in seconds, that the resource will wait for the requested action to take place. We are now talking about only the execution of the stored procedure in our example above. Don’t set this number so low as to interfere with the timings discussed above. When this number has been exceeded, the resource will raise an error which will be sent back to the HHT. However, the stored procedure will still run until it ends successfully or the database monitor itself terminates it (ex. fatal embrace).
Other Things to Consider
The application has 50 HHT’s on the floor that are performing real time processing of validations and updates. The resource has only 1 agent active.
10 HHT’s send up a transaction at the same exact second (10:00:00) and they are all received by SBS-Pathfinder™ in 1 second (10:00:01) and written to the resource Q. They are all destined for the same resource. The first HHT gets it result back at 10:00:01 the second HHT at 10:00:02 the third at 10:00:03 the eight at 10:00:08 and the nineth and tenth timeout because they never received a response back. The 8 seconds in the above example was exceeded. Even though the transaction only takes 1 second to run, because of the volume, it still times out. If you have heavy volume resource requests, you should use more then 1 agent resource.
Always perform error checking after sending a request to a SBS-Pathfinder™ resource to be processed.