Was this page helpful?
A session object is used to execute queries and maintains cluster state through the control connection. The control connection is used to auto-discover nodes and monitor cluster changes (topology and schema). Each session also maintains multiple pools of connections to cluster nodes which are used to query the cluster.
Instances of the session object are thread-safe to execute queries.
Public Functions
Creates a new session.
See also
Returns a session that must be freed.
Frees a session instance. If the session is still connected it will be synchronously closed before being deallocated.
Important: Do not free a session in a future callback. Freeing a session in a future callback will cause a deadlock.
session – [in]
Connects a session.
See also
session – [in]
cluster – [in] The cluster configuration is copied into the session and is immutable after connection.
A future that must be freed.
Connects a session and sets the keyspace.
See also
session – [in]
cluster – [in] The cluster configuration is copied into the session and is immutable after connection.
keyspace – [in]
A future that must be freed.
Same as cass_session_connect_keyspace(), but with lengths for string parameters.
See also
session – [in]
cluster – [in]
keyspace – [in]
keyspace_length – [in]
same as cass_session_connect_keyspace()
Closes the session instance, outputs a close future which can be used to determine when the session has been terminated. This allows in-flight requests to finish.
session – [in]
A future that must be freed.
Create a prepared statement.
See also
session – [in]
query – [in] The query is copied into the statement object; the memory pointed to by this parameter can be freed after this call.
A future that must be freed.
Same as cass_session_prepare(), but with lengths for string parameters.
See also
session – [in]
query – [in]
query_length – [in]
same as cass_session_prepare()
Create a prepared statement from an existing statement.
Note: Bound statements will inherit the keyspace, consistency, serial consistency, request timeout and retry policy of the existing statement.
See also
session – [in]
statement – [in]
A future that must be freed.
Execute a query or bound statement.
See also
session – [in]
statement – [in]
A future that must be freed.
Execute a batch statement.
Requires Apache Cassandra: 2.0+
See also
session – [in]
batch – [in]
A future that must be freed.
Gets a snapshot of this session’s schema metadata. The returned snapshot of the schema metadata is not updated. This function must be called again to retrieve any schema changes since the previous call.
See also
session – [in]
A schema instance that must be freed.
Gets a copy of this session’s performance/diagnostic metrics.
session – [in]
output – [out]
Gets a copy of this session’s speculative execution metrics.
session – [in]
output – [out]
Get the client id.
session – [in]
Client id.
Was this page helpful?
On this page
CassSession
CassSession::cass_session_new()
CassSession::cass_session_free()
CassSession::cass_session_connect()
CassSession::cass_session_connect_keyspace()
CassSession::cass_session_connect_keyspace_n()
CassSession::cass_session_close()
CassSession::cass_session_prepare()
CassSession::cass_session_prepare_n()
CassSession::cass_session_prepare_from_existing()
CassSession::cass_session_execute()
CassSession::cass_session_execute_batch()
CassSession::cass_session_get_schema_meta()
CassSession::cass_session_get_metrics()
CassSession::cass_session_get_speculative_execution_metrics()
CassSession::cass_session_get_client_id()