DirectConnect database gateways

In a Sybase replication system, the purpose of a DirectConnect database gateway is to apply transactions from a Replication Server to a non-Sybase replicate database.

To accomplish this, Replication Server logs in to the DirectConnect gateway using the information specified for a Replication Server connection. Replication Server logs in to the server using the user_name and password, and issues a use database command for the database defined in the connection.

For Replication Server, there is nothing to distinguish a DirectConnect gateway from an Adaptive Server replicate database. Replication Server delivers the same commands—and expects the same results—from any DSI thread it communicates with.

This has the following implications:

Interfaces file

Replication Server is an Open Server application. In an Open Server application, the preferred method for determining the location (host and port number) of another Open Server is to look up the location in an interfaces file. The interfaces file contains a list of labels, typically server names, of which each have a corresponding host name and port number, where the identified server should be “listening” for login requests.

In the interaction between a DirectConnect database gateway and a Replication Server, the interfaces file is important. Because the Replication Server does attempt to log in to the server identified by the server name in the Replication Server connection, that server name must exist in the Replication Server interfaces file. In addition, the interfaces file entry must also exist as a service name in the DirectConnect gateway configuration file entries.

A single DirectConnect can act as a gateway for one or many different database instances. In the DirectConnect configuration, each database to be accessed by the DirectConnect is configured as a unique service name. For DirectConnect to know which configured service name a client wants to connect to, it uses the server name passed at login time and expects to find a matching service name to use to complete the connection. Not only must the Replication Server server_name in the connection match an interfaces file entry, but that interfaces file entry must match the DirectConnect service name describing the database you want to connect to. For more information on the role of service names and their configurations, refer to the DirectConnect Access Service User's Guide.

Connection shared by Replication Agent and DirectConnect

A single Replication Server connection can support both a DirectConnect gateway and a Replication Agent, because each of these components connects to the Replication Server on a different thread. If you replicate information both into and out of the same database, having a common connection for both a database gateway and a Replication Agent can make the replication system network topology simpler. On the other hand, because the Replication Agent and the DirectConnect gateway are two separate servers, it might be more intuitive to have a separate connection for each one.

To share a Replication Server connection between a DirectConnect gateway and a Replication Agent, you must define the connection to correctly support the replicate database, then configure the Replication Agent appropriately: