About the ADO.NET Driver

The GemFire XD ADO.NET driver is an implementation of Microsoft's ADO.NET interfaces and abstract classes. It provides connectivity to a GemFire XD system as a network client driver. In this release of GemFire XD, the ADO.NET driver does not support running a GemFire XD member in an embedded mode (embedded driver) within an application.

The driver provides fast access to a GemFire XD cluster from .NET clients and enables advanced GemFire XD features such as:

You can access the driver through any .NET language including C#, C++/CLI, and Visual Basic .NET. As with the JDBC network driver, the ADO.NET driver complies with the DRDA standard protocol and utilizes several GemFire XD extensions to provide enhanced features.

The following sections provide more information about the ADO.NET driver:

High Availability

The ADO.NET driver maintains information about the servers available in a GemFire XD cluster. If the server to which the client is connected goes down, then the driver automatically re-routes the connection to another server available in the cluster.

To take full advantage of this feature, clients should connect using the address of a stand-alone GemFire XD locator rather than a GemFire XD server, because locators provide more accurate information about the available servers to which a client can fail over. If you specify the address of a server rather than a stand-alone locator, then it is possible that the client will fail to find any available server if those servers have been taken offline.

Note: The automatic failover feature assumes the client's initial connection to the specified GemFire XD locator succeeds. To improve the chances of establishing an initial connection to a GemFire XD system, use the secondary-locators property to specify the addresses of one or more secondary locators try if the primary locator cannot be reached. For example, use a connection string similar to "server=primary-locator-address:port;secondary-locators=secondary-locator1-address:port,secondary-locator2-address:port" when you initiate a connection using the ADO.NET driver.

If the application is not executing a transaction, then failover occurs transparently to the application. Failed operations are automatically re-executed if necessary. The application does not receive any exceptions as long as at least one server is available in the cluster to service network clients.

However, when querying LOB data-types (BLOB/CLOB), clients may receive an GFXDException with State "XJ217" due to the LOB handle not being found on the new server. In this case, the client may need to retry the query explicitly.

In this release of GemFire XD, if the application is in the middle of a transaction and the server to which client is connected fails, then the current transaction fails with a connection exception (GFXDException with State "08006") and the application must re-execute the transaction. To handle such a case, applications can create a new connection, and then begin a new transaction and retry the transaction.

Load Balancing

When using the GemFire XD locator or a locator embedded inside a server, servers inform the active locator of the load on each server using the number of current client connections on the server. This allows the locator to determine the best server to use for a new client connection. In this way, a network client that connects using a locator is always directed to the least-loaded server in the cluster.

Extensions for Batching and Row Locking

Similar to the JDBC API, the ADO.NET driver provides extensions to the DbCommand API to allow for batching without requiring a DbDataAdapter. Also, the DbDataReader implementation, GFXDDataReader, allows for expressing the intent to lock rows when executing a SELECT … FOR UPDATE statement. Additional extensions from the JDBC API are also provided, such as GFXDConnection.AutoCommit.