Examples

All of the examples assume that each XDB Server has already been set up with the appropriate information in the system tables. If a request is made to connect to an unknown location not listed in the system tables, an X288 error message (Statement reference to remote object is invalid) is returned to the user.

Client1 is logged into the XDB Server xdbserve and is running the SQL Wizard. Client1 issues a SET LOCATION TO ORDERS command. The xdbserve server checks its system table SYSIBM.SYSLOCATIONS, which indicates that the location orders is controlled by the XDB Server sales.

The xdbserve server transfers the clients connection to the XDB Server sales. Note that each communication between client1 and the XDB Server sales must go through xdbserve (shown by the dashed lines through xdbserve).

Now, any requests that are sent by the client are verified by the system tables on the XDB Server sales. If client1 issues a SELECT query that references the table eastern.may without specifying a location, it is assumed that this table is in the location orders on the XDB Server sales.

To continue the example, client1 (who is logged in to xdbserve but connected to sales) issues a SET LOCATION TO PRODUCTS command. In this case, sales checks its system catalog table SYSIBM.SYSLOCATIONS, which indicates that the location products is controlled by the XDB Server develop.

Sales transfers the client's connection to the XDB Server develop. Any requests that are sent by the client are verified by the system catalog tables on the XDB Server develop. Communication between client1 and develop must still pass between the other XDB Servers to which it has been connected, xdbserve and sales. This communication is shown by the dashed lines through the XDB Servers.

Finally, consider that client1, connected to develop via xdbserve and sales, issues a SET LOCATION TO STAFF command. In this case, develop checks its system catalog table SYSIBM.SYSLOCATIONS, which indicates that the location staff is controlled by the XDB Server xdbserve.

This will create a communications loop back to xdbserve. This type of looping is not recommended, as the connections between the various servers creates congestion on each server. In addition, response time is increased because queries have to be passed between multiple servers.

Instead, keep track of the locations and servers you have accessed. If you are working interactively (for example, through the SQL Wizard), then log out and log back in. If you are using embedded SQL, issue CONNECT RESET commands after you no longer need the data on a particular server.