Since BBj 1.0, PRO/5 applications have access to BBj managed data files via the BBj PRO/5 Data Server (DS) using standard PRO/5 DS syntax. Using a combination of BBj 15.00+ and PRO/5 version 15.00+, developers have the ability to bypass the network communication layer if PRO/5 and BBjServices are running on the same machine using a new PRO/5 Memory Mapped protocol.
Configuring BBj to Accept PRO/5 Requests
BBj uses its PRO/5 DS to provide access to the BBj file system from PRO/5 applications. PRO/5 accesses this server either remotely using the hostname of the machine or directly using the Memory Mapped protocol when PRO/5 and BBj are present on the same machine and PRO/5 uses 127.0.0.1 for the hostname in data server syntax paths.
The following steps describe how to use the Enterprise Manager to configure the BBj PRO/5 DS:
Double click on the Servers item under BBjServices in the EM navigator to open the configuration page shown in Figure 1.
Expand the properties under the PRO/5 DS 5.0 item.
Set Run Server to true to enable the server.
Adjust any additional settings as necessary.
Save the changes.
- Click the run server tool button (play icon) or restart BBjServices to start the server.
Figure 1. Configure the BBj PRO/5 DS to run automatically on startup.
Configuring PRO/5 to Use Data Server Syntax
Two methods exist for instructing PRO/5 to use data server syntax: (1) programmatically and (2) via the config.bbx file. The advantage to using the config.bbx file is that changes to the configuration or path do not require any application code changes.
Set the appropriate SETOPTS bit to enable data server communication. Optionally, follow that the SETOPTS call with an instruction telling PRO/5 to use a particular data server for all OPEN calls:
LET TMP$=STBL(“!DSOPEN”, “/<127.0.0.1,port=2100>”)
To require each OPEN call to explicitly require the full data server path when necessary (such as when some file access occurs directly and some via a data server), do not set the STBL value, but instead, specify the path on the OPEN call:
Configuration FileUse the config.bbx method of configuration to easily make the change to use the Memory Mapped protocol without any code changes. Note that application structure determines whether a simple change to the config.bbx file accomplishes everything necessary to switch to use BBj for file access. Configuration requires two steps:
Add or modify the existing SETOPTS line enabling byte 4, bit $20$:
Add the following SET line:
BBj Functionality Available When Using Data Server Syntax
Accessing data files through a BBj PRO/5 Data Server enables PRO/5 to benefit from a number of BBj-specific filesystem features including: