C# Class CqlSharp.CqlConnection

A connection to a Cassandra cluster
Inheritance: IDisposable
Afficher le fichier Open project: reuzel/CqlSharp Class Usage Examples

Private Properties

Свойство Type Description
CompleteOpen void
CqlConnection System
GetConnection Connection
OpenAsyncInternal Task
OpenAsyncInternal2 Task

Méthodes publiques

Méthode Description
BeginTransaction ( ) : CqlBatchTransaction

Begins the transaction.

BeginTransaction ( IsolationLevel isolationLevel ) : CqlBatchTransaction

Begins the transaction.

Cancel ( ) : void

Cancels any ongoing open operation.

ChangeDatabase ( string databaseName ) : void

Changes the current database for an open connection.

Close ( ) : void

Closes the connection to the database. This is the preferred method of closing any open connection.

CqlConnection ( CqlConnectionStringBuilder config ) : System

Initializes a new instance of the CqlConnection class.

CqlConnection ( string connectionString ) : System

Initializes a new instance of the CqlConnection class.

CreateCqlCommand ( ) : CqlCommand

Creates and returns a T:CqlSharp.CqlCommand object associated with the current connection.

Open ( ) : void

Opens a database connection with the settings specified by the .

OpenAsync ( CancellationToken cancellationToken ) : Task

This is the asynchronous version of M:System.Data.Common.DbConnection.Open. The cancellation token can optionally be honored.The default implementation invokes the synchronous call and returns a completed task. The default implementation will return a cancelled task if passed an already cancelled cancellationToken. Exceptions thrown by Open will be communicated via the returned Task Exception property.Do not invoke other methods and properties of the DbConnection object until the returned Task is complete.

OpenInternal ( ) : void

Opens the connection with full cancellation support.

SetConnectionTimeout ( int timeout ) : void

Sets the connection timeout.

Shutdown ( string connectionString ) : void

Shutdowns all interaction with the cluster as specified by the connection string.

This will close all open connection, and thereby fail all ongoing cql operations.

ShutdownAll ( ) : void

Shutdowns all interactions with all known clusters

This will close all open connection, and thereby fail all ongoing cql operations.

Méthodes protégées

Méthode Description
BeginDbTransaction ( IsolationLevel isolationLevel ) : DbTransaction

Starts a database transaction.

CreateDbCommand ( ) : DbCommand

Creates and returns a T:System.Data.Common.DbCommand object associated with the current connection.

Dispose ( bool disposing ) : void

Releases the unmanaged resources used by the T:System.ComponentModel.Component and optionally releases the managed resources.

Private Methods

Méthode Description
CompleteOpen ( Logger logger ) : void
CqlConnection ( ) : System

Initializes the CqlConnection class.

GetConnection ( PartitionKey partitionKey = default(PartitionKey) ) : Connection

Requests a connection to be used for a command. Will reuse connection level connection if available

OpenAsyncInternal ( CancellationToken cancellationToken ) : Task

Opens the connection.

OpenAsyncInternal2 ( Logger logger, CancellationToken cancellationToken ) : Task

Opens the connection.

Method Details

BeginDbTransaction() protected méthode

Starts a database transaction.
protected BeginDbTransaction ( IsolationLevel isolationLevel ) : DbTransaction
isolationLevel IsolationLevel Specifies the isolation level for the transaction.
Résultat DbTransaction

BeginTransaction() public méthode

Begins the transaction.
public BeginTransaction ( ) : CqlBatchTransaction
Résultat CqlBatchTransaction

BeginTransaction() public méthode

Begins the transaction.
public BeginTransaction ( IsolationLevel isolationLevel ) : CqlBatchTransaction
isolationLevel IsolationLevel The isolation level.
Résultat CqlBatchTransaction

Cancel() public méthode

Cancels any ongoing open operation.
public Cancel ( ) : void
Résultat void

ChangeDatabase() public méthode

Changes the current database for an open connection.
/// CqlConnection must be open before Database can be changed. /// or /// Changing a database is only supported with a ConnectionStrategy that offers exclusive connections ///
public ChangeDatabase ( string databaseName ) : void
databaseName string Specifies the name of the database for the connection to use.
Résultat void

Close() public méthode

Closes the connection to the database. This is the preferred method of closing any open connection.
public Close ( ) : void
Résultat void

CqlConnection() public méthode

Initializes a new instance of the CqlConnection class.
public CqlConnection ( CqlConnectionStringBuilder config ) : System
config CqlConnectionStringBuilder The config.
Résultat System

CqlConnection() public méthode

Initializes a new instance of the CqlConnection class.
public CqlConnection ( string connectionString ) : System
connectionString string The connection string.
Résultat System

CreateCqlCommand() public méthode

Creates and returns a T:CqlSharp.CqlCommand object associated with the current connection.
public CreateCqlCommand ( ) : CqlCommand
Résultat CqlCommand

CreateDbCommand() protected méthode

Creates and returns a T:System.Data.Common.DbCommand object associated with the current connection.
protected CreateDbCommand ( ) : DbCommand
Résultat DbCommand

Dispose() protected méthode

Releases the unmanaged resources used by the T:System.ComponentModel.Component and optionally releases the managed resources.
protected Dispose ( bool disposing ) : void
disposing bool /// true to release both managed and unmanaged resources; false to release only unmanaged /// resources. ///
Résultat void

Open() public méthode

Opens a database connection with the settings specified by the .
public Open ( ) : void
Résultat void

OpenAsync() public méthode

This is the asynchronous version of M:System.Data.Common.DbConnection.Open. The cancellation token can optionally be honored.The default implementation invokes the synchronous call and returns a completed task. The default implementation will return a cancelled task if passed an already cancelled cancellationToken. Exceptions thrown by Open will be communicated via the returned Task Exception property.Do not invoke other methods and properties of the DbConnection object until the returned Task is complete.
Connection must be closed before it is opened
public OpenAsync ( CancellationToken cancellationToken ) : Task
cancellationToken System.Threading.CancellationToken The cancellation instruction.
Résultat Task

OpenInternal() public méthode

Opens the connection with full cancellation support.
CqlConnection Open has been aborted by user CqlConnection.Open timed out.
public OpenInternal ( ) : void
Résultat void

SetConnectionTimeout() public méthode

Sets the connection timeout.
public SetConnectionTimeout ( int timeout ) : void
timeout int The timeout in seconds
Résultat void

Shutdown() public static méthode

Shutdowns all interaction with the cluster as specified by the connection string.
This will close all open connection, and thereby fail all ongoing cql operations.
public static Shutdown ( string connectionString ) : void
connectionString string The connection string.
Résultat void

ShutdownAll() public static méthode

Shutdowns all interactions with all known clusters
This will close all open connection, and thereby fail all ongoing cql operations.
public static ShutdownAll ( ) : void
Résultat void