RAD Studio
ContentsIndex
PreviousUpNext
Connecting to an Application Server That Uses Multiple Data Modules

If a COM-based application server uses a main "parent" remote data module and several child remote data modules, as described in Using multiple remote data modules, then you need a separate connection component for every remote data module on the application server. Each connection component represents the connection to a single remote data module. 

While it is possible to have your client application form independent connections to each remote data module on the application server, it is more efficient to use a single connection to the application server that is shared by all the connection components. That is, you add a single connection component that connects to the "main" remote data module on the application server, and then, for each "child" remote data module, add an additional component that shares the connection to the main remote data module.

To use a single shared connection

  1. For the connection to the main remote data module, add and set up a connection component as described in Connecting to the Application Server. The only limitation is that you can't use a SOAP connection.
  2. For each child remote data module, use a TSharedConnection component.
    • Set its ParentConnection property to the connection component you added in step 1. The TSharedConnection component shares the connection that this main connection establishes.
    • Set its ChildName property to the name of the property on the main remote data module's interface that exposes the interface of the desired child remote data module.
When you assign the TSharedConnection component placed in step 2 as the value of a client dataset's RemoteServer property, it works as if you were using an entirely independent connection to the child remote data module. However, the TSharedConnection component uses the connection established by the component you placed in step 1.

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!