Avoiding connection errors to JIT server for remote clients

Date:10 December 2008
Product/Release:Visual LANSA
Abstract:If the connection to the JIT Server fails, an error message is shown; this tip includes one possible way to avoid this error message
Submitted By:LANSA Technical Support

Description:

In an application that is updated by Just In Time deployments (JIT), a connection is made to the JIT Server on application startup. If the connection fails, an error message is shown which prompts the user whether to continue. This mechanism is designed for fixed PCs with a reliable connection to the internet, and it would indicate a problem that needs investigating. However for remote clients that might only have periodic internet access, it may mean an unwanted error message.

Solution:

One possible solution would be to have separate start-files (and separate icons) that allows the user to select whether to start the application with the JIT upgrade enabled or not. But this involves the user knowing the status of their network connection.

Another solution is to use a batch file which will check the connection and then launch the appropriate start-file. This means the user will only need one icon to launch the application. The batch file which will throw a single Ping to the application upgrade server. Depending on the result, it will start the application with the JIT upgrade check, or without (using 2 different start files):

@echo off
cls
for /f %%a in ('"ping -n 1 <server> |find "TTL""') do goto found
:notfound
echo Did not find the server!
X_Run.exe no_network_startfile
goto end
:found
echo Found the server...
X_Run.exe has_network_startfile
goto end
:end

In the batch file above, replace <server> with the network address or IP address of the JIT server. It is also possible to use a third-party tool to convert the batchfile into an Executable (hiding the batch source, and making it run somewhat quicker). Removing the Echo statements would mean the batch file is silent and virtually unnoticeable.