Shard.openConnectionAsync Method

Definition

Overloads

openConnectionAsync(String connectionString)

Asynchronously opens a regular SqlConnection to the specified shard, with Validate.

openConnectionAsync(String connectionString, ConnectionOptions options)

Asynchronously a regular SqlConnection to the specified shard.

openConnectionAsync(String connectionString)

Asynchronously opens a regular SqlConnection to the specified shard, with Validate.

public Callable<Connection> openConnectionAsync(String connectionString)

Parameters

connectionString
String

Connection string with credential information such as SQL Server credentials or Integrated Security settings. The hostname of the server and the database name for the shard are obtained from the lookup operation for key.

Returns

Callable<Connection>

A Task encapsulating an opened SqlConnection Note that the SqlConnection object returned by this call is not protected against transient faults. Callers should follow best practices to protect the connection against transient faults in their application code, e.g., by using the transient fault handling functionality in the Enterprise Library from Microsoft Patterns and Practices team. All non-usage errors will be propagated via the returned Task.

openConnectionAsync(String connectionString, ConnectionOptions options)

Asynchronously a regular SqlConnection to the specified shard.

public Callable<Connection> openConnectionAsync(String connectionString, ConnectionOptions options)

Parameters

connectionString
String

Connection string with credential information such as SQL Server credentials or Integrated Security settings. The hostname of the server and the database name for the shard are obtained from the lookup operation for key.

options
ConnectionOptions

Options for validation operations to perform on opened connection.

Returns

Callable<Connection>

A Task encapsulating an opened SqlConnection Note that the SqlConnection object returned by this call is not protected against transient faults. Callers should follow best practices to protect the connection against transient faults in their application code, e.g., by using the transient fault handling functionality in the Enterprise Library from Microsoft Patterns and Practices team. All non-usage errors will be propagated via the returned Task.

Applies to