Manage IBM i communications sessions for application programs

System Object Access APIs communicate with the system through the use of one or more client/server conversations.

Because it often takes several seconds to establish a conversation, your application may experience delays when a list first is opened. This topic explains how to control and manage the initiation of conversations so that the performance impact on application programs is minimized.

The default behavior of System Object Access may be summarized as follows:

  • If no conversation has been established with the IBM i object that is identified on the CWBSO_CreateListHandleEx API, a conversation automatically will be started when the list is opened or displayed. If a connection is not already established to the specified system, a dialog box will appear prompting the user for the appropriate UserID and password.
  • If another instance of the application program starts, the above process repeats itself. No conversation sharing occurs between application programs that run in different processes (that is, with different instance handles).
  • When the application program deletes the last System Object Access list, the IBM i conversation is automatically ended (Note that CWBSO_CloseList does not end the IBM i conversation).

A System Object Access conversation may be started using the cwbRC_StartSysEx API. This API accepts an IBM i object as a parameter, and returns a system handle. Save this handle for later use on the cwbRC_StopSys API, when the application is terminating and it is time to end the IBM i conversation.

When the cwbRC_StartSysEx API is called, the application is blocked until the conversation is established. Therefore, it is good practice to inform the user that a connection is about to be attempted immediately before the call. On return, the conversation will have been initiated, and System Object Access list processing will use this conversation instead of starting a new one.

When cwbRC_StartSysEx is used in this way, the last list to be deleted will not end the conversation. You must call cwbRC_StopSys explicitly before you exit the application.