4D v16.3

Management of connections by client applications

Home

 
4D v16.3
Management of connections by client applications

Management of connections by client applications  


 

 

The management of connections by client applications covers the mechanisms by which a merged client application connects to the target server, once it is in its production environment.

Starting with 4D v15 R4, these mechanisms have been modified in order to provide more control to the developer and more flexibility in case of connection error.

The mechanisms available beginning with 4D v15 R4 described on this page are enabled only when the Use new architecture for application deployments option on the "Compatibility" page of the Database Settings dialog box is checked (see the Compatibility page section).

The connection procedure for merged client applications supports cases where the dedicated server is not available. The startup scenario for a 4D client application is the following:

  • The client application tries to connect to the server using the discovery service (based upon the server name, broadcasted on the same subnet).
    OR
    If valid connection information is stored in the EnginedServer.4DLink file within the client application, the client application tries to connect to the specified server address.
    Compatibility note: When the compatibility option is not checked (see the Compatibility section), if a failure occurs at this stage, the standard "Server connection" dialog box is displayed directly.
  • If this fails, the client application tries to connect to the server using information stored in the application's user preferences folder (lastServer.xml file, see last step).
  • If this fails, the client application displays a connection error dialog box.
    • If the user clicks on the Select... button (when allowed by the 4D developer at the build step, see below), the standard "Server connection" dialog box is displayed.
    • If the user clicks on the Quit button, the client application quits.
  • If the connection is successful, the client application saves this connection information in the application's user preferences folder for future use.

The last used and validated server path is automatically saved in a file named lastServer.xml in the application's user preferences folder. This folder is stored at the following location:

 userPrefs:=Get 4D folder(Active 4D Folder)

Compatibility note: When this compatibility option is not checked (see the Compatibility section), the path is not saved.

This mechanism addresses the case where the primary targeted server is temporary unavailable for some reason (maintenance mode for example). When this case occurs for the first time, the server selection dialog box is displayed (if allowed, see below) and the user can manually select an alternate server, whose path is then saved if the connection is successful. Any subsequent unavailability would be handled automatically through the lastServer.xml path information.

Notes:

  • When client applications cannot permanently benefit from the discovery service, for example because of the network configuration, it is still recommended that the developer provide a host name at build time using the IPAddress key in the BuildApp.xml file. The new mechanism addresses cases of temporary unavailability.
  • Pressing the Alt/Option key at startup to display the server selection dialog box is still supported in all cases.

You can choose whether or not to display the standard server selection dialog box on merged client applications when the server cannot be reached.

In this case, the configuration depends on the Use new architecture for application deployments compatibility option (see the Compatibility section) as well as the value of the ServerSelectionAllowed XML key on the machine where the application was built. There are three possibilities:

  • Display of an error message with no access possible to the server selection dialog box
    Default operation for databases created starting with 4D v15 R4.The application can only quit. This functioning is obtained with the following configuration:
    • Use new architecture for application deployments option: checked
    • ServerSelectionAllowed XML key: value False or key omitted

  • Display of an error message with access to the server selection dialog box possible
    The user can access the server selection window by clicking on the Select... button. This functioning is obtained with the following configuration:
    • Use new architecture for application deployments option: checked
    • ServerSelectionAllowed XML key: value True

    =>

  • Direct display of server selection dialog box
    Default operation for converted databases. This is the functioning of previous versions of 4D. It is obtained with the following configuration:
    • Use new architecture for application deployments option: unchecked
    • ServerSelectionAllowed XML key: ignored

Note: For more information about the ServerSelectionAllowed XML key, refer to its description in the 4D XML Keys BuildApplication manual.



See also 

Compatibility page

 
PROPERTIES 

Product: 4D
Theme: Finalizing and deploying final applications

 
HISTORY 

Modified: 4D v15 R4

 
ARTICLE USAGE

4D Design Reference ( 4D v16)
4D Design Reference ( 4D v16.1)
4D Design Reference ( 4D v16.3)