connectUsingSharedEnvironment

fun connectUsingSharedEnvironment(connectionString: String, username: String, password: String, env: ClusterEnvironment): Cluster

Connects to a Couchbase cluster, authenticating with username and password.

Use this method if you are connecting to multiple clusters and want to share the same ClusterEnvironment for improved performance.

IMPORTANT: You are responsible for shutting down the environment after all the clusters sharing it have disconnected.

See also


fun connectUsingSharedEnvironment(connectionString: String, authenticator: Authenticator, env: ClusterEnvironment): Cluster

Connects to a Couchbase cluster using an alternate authentication strategy like CertificateAuthenticator.

Use this method if you are connecting to multiple clusters and want to share the same ClusterEnvironment for improved performance.

IMPORTANT: You are responsible for shutting down the environment after all the clusters sharing it have disconnected.

See also