Google Cloud Spanner v1 API - Class ManagedSessionOptions (5.13.0-beta03)

public sealed class ManagedSessionOptions

Reference documentation and code samples for the Google Cloud Spanner v1 API class ManagedSessionOptions.

Options to used when creating a managed session.

Inheritance

object > ManagedSessionOptions

Namespace

Google.Cloud.Spanner.V1

Assembly

Google.Cloud.Spanner.V1.dll

Properties

Client

public SpannerClient Client { get; }

The Spanner client to use for all operations associated to the session, including session creation. Won't be null.

Property Value
Type Description
SpannerClient

DatabaseName

public DatabaseName DatabaseName { get; }

The database for which the session will be created. Won't be null.

Property Value
Type Description
Google.Cloud.Spanner.Common.V1.DatabaseName

DatabaseRole

public string DatabaseRole { get; }

The database role with which the session will be created. May be null, in which case the default (public) database role is used if fine grained access control is enabled; otherwise the database role is ignored.

Property Value
Type Description
string

Timeout

public TimeSpan? Timeout { get; }

The total time allowed for a network call to the Cloud Spanner server, including retries. This setting is applied to calls to create sessions, as well as explicitly beginning transactions. May be null, in which case 1 minute will be used. Otherwise, the value will be positive.

Property Value
Type Description
TimeSpan

Methods

Create(DatabaseName, SpannerClient)

public static ManagedSessionOptions Create(DatabaseName databaseName, SpannerClient client)

Creates a ManagedSessionOptions with the given database name.

Parameters
Name Description
databaseName Google.Cloud.Spanner.Common.V1.DatabaseName

The database name for the associated session. Must not be null.

client SpannerClient

The Spanner client that the sessions will use for all command execution, including those executed by associated ManagedTransaction.

Returns
Type Description
ManagedSessionOptions

WithDatabaseRole(string)

public ManagedSessionOptions WithDatabaseRole(string databaseRole)

Creates a ManagedSessionOptions based on this one but with the given database role.

Parameter
Name Description
databaseRole string

The database role for the associated session. May be null in which case the default (public) database role is used if fine grained access control is enabled; otherwise the database role is ignored.

Returns
Type Description
ManagedSessionOptions

WithTimeout(TimeSpan?)

public ManagedSessionOptions WithTimeout(TimeSpan? timeout)

Creates a ManagedSessionOptions based on this one but with the given timeout.

Parameter
Name Description
timeout TimeSpan

The total time allowed for a network call to the Cloud Spanner server, including retries. This setting is applied to calls to create sessions, as well as explicitly beginning transactions. May be null, in which case 1 minute will be used. Otherwise, the value must be positive.

Returns
Type Description
ManagedSessionOptions