C# Класс CqlSharp.CqlConnection

A connection to a Cassandra cluster
Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
CompleteOpen void
CqlConnection System
GetConnection Connection
OpenAsyncInternal Task
OpenAsyncInternal2 Task

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
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.

Приватные методы

Метод Описание
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.

Описание методов

BeginDbTransaction() защищенный Метод

Starts a database transaction.
protected BeginDbTransaction ( IsolationLevel isolationLevel ) : DbTransaction
isolationLevel IsolationLevel Specifies the isolation level for the transaction.
Результат DbTransaction

BeginTransaction() публичный Метод

Begins the transaction.
public BeginTransaction ( ) : CqlBatchTransaction
Результат CqlBatchTransaction

BeginTransaction() публичный Метод

Begins the transaction.
public BeginTransaction ( IsolationLevel isolationLevel ) : CqlBatchTransaction
isolationLevel IsolationLevel The isolation level.
Результат CqlBatchTransaction

Cancel() публичный Метод

Cancels any ongoing open operation.
public Cancel ( ) : void
Результат void

ChangeDatabase() публичный Метод

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.
Результат void

Close() публичный Метод

Closes the connection to the database. This is the preferred method of closing any open connection.
public Close ( ) : void
Результат void

CqlConnection() публичный Метод

Initializes a new instance of the CqlConnection class.
public CqlConnection ( CqlConnectionStringBuilder config ) : System
config CqlConnectionStringBuilder The config.
Результат System

CqlConnection() публичный Метод

Initializes a new instance of the CqlConnection class.
public CqlConnection ( string connectionString ) : System
connectionString string The connection string.
Результат System

CreateCqlCommand() публичный Метод

Creates and returns a T:CqlSharp.CqlCommand object associated with the current connection.
public CreateCqlCommand ( ) : CqlCommand
Результат CqlCommand

CreateDbCommand() защищенный Метод

Creates and returns a T:System.Data.Common.DbCommand object associated with the current connection.
protected CreateDbCommand ( ) : DbCommand
Результат DbCommand

Dispose() защищенный Метод

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. ///
Результат void

Open() публичный Метод

Opens a database connection with the settings specified by the .
public Open ( ) : void
Результат void

OpenAsync() публичный Метод

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.
Результат Task

OpenInternal() публичный Метод

Opens the connection with full cancellation support.
CqlConnection Open has been aborted by user CqlConnection.Open timed out.
public OpenInternal ( ) : void
Результат void

SetConnectionTimeout() публичный Метод

Sets the connection timeout.
public SetConnectionTimeout ( int timeout ) : void
timeout int The timeout in seconds
Результат void

Shutdown() публичный статический Метод

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.
Результат void

ShutdownAll() публичный статический Метод

Shutdowns all interactions with all known clusters
This will close all open connection, and thereby fail all ongoing cql operations.
public static ShutdownAll ( ) : void
Результат void