PRO/5 Memory Mapped Data Server Access
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.
Note:
The Memory Mapped Protocol is only supported for PRO/5, not for VPRO/5.
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.
Programmatically
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:
SETOPTS $00000020$
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:
OPEN(chan)”/<127.0.0.1,port=2100>/path/to/file”
Configuration File
Use 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$:
setopts 00000020
Add the following SET line:
set !DSOPEN=/<127.0.0.1,port=2100>
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:
File Creation Verbs
It is important to note that when running PRO/5 with !DSOPEN to make use of the BBj PRO/5 Data Server with Memory Mapped Protocol, file creation verbs are not handled by the BBj PRO/5 Data Server.
File creation verbs are interpreter-level operations, so (V)PRO/5 is unable to create file types that were introduced after (V)PRO/5, such as VKEYED and XKEYED, although it is able to READ and WRITE to those file types with some limitations (such as not being able to use the named KEY syntax).
To initiate the creation of file types that were introduced after (V)PRO/5, use the XCALL verb to leverage the BBj Interpreter for the creation of the files.