Remote data access is not fully supported in OLE DB, Version 2.0.
Future Direction
Future versions of OLE DB will enable efficient and transparent access between consumers and providers across threads, process, and machine boundaries. In the following discussion, the term process boundary refers to a process or machine boundary.
OLE DB includes two forms of remoting: data remoting and object (or interface) remoting.
In data remoting, a provider driver exposing OLE DB interfaces is present on the client side. All interaction with the provider is through the driver. All details about communication protocol, data transfer format, and the provider's native interface calls are handled internally by the driver—for example, an OLE DB provider accessing an SQL DBMS through ODBC. In other words, the process or machine boundary cuts through the provider's driver. The consumer/provider relationship is entirely within a single process.
In interface remoting, an OLE DB provider is running remotely in a different process. Interface remoting provides the infrastructure and mechanisms that enable a method call to return an interface pointer to an object created in a different process. The infrastructure that performs the remoting of interfaces is transparent to both the client and the server object. Neither the client or server object are aware that the other party is in a different process. Distributed COM (DCOM) (another COM technology, available in Windows NT 4.0 and later) provides an open specification and reference implementation of such an infrastructure.
The following figure illustrates the various configurations in which consumer and provider code can exist. Clients always call in-process code. Objects are always called by in-process code.
Consumer/Provider code configurations
The proxy/stub agents are agents that take care of marshaling arguments across the process boundary and optimize access over the network by trying to hide the latency and bandwidth. Their design is an open-ended optimization problem. Proxies and stubs may vary in complexity. Simple proxy/stub pairs provide marshaling of arguments to method calls. Sophisticated proxy/stub pairs may provide client-side caching combined with bulk data transfer over the process boundary to minimize network trips, or may even combine method calls, thereby optimizing network trips across multiple method calls.
Providers may choose to implement their remote data access by either approach. The OLE DB Provider for ODBC (included in this Data Access SDK) provides an implementation of data remoting through ODBC. In the ODBC provider, all process and network communications are managed internally by the ODBC driver. Future versions of the OLE DB SDK will provide a reference implementation of interface remoting, packaged as a library of generic proxy/stub pairs for all OLE DB objects. Providers that want to have a tighter control over the performance of their OLE DB implementations across threads, process, and machine boundaries are free to implement their own remoting agents by using the network protocol and optimizations of their choice.