Class ProjectsResource.InstancesResource.DatabasesResource.SessionsResource.CreateRequest
Creates a new session. A session can be used to perform transactions that read and/or modify
data in a Cloud Spanner database. Sessions are meant to be reused for many consecutive
transactions. Sessions can only execute one transaction at a time. To execute multiple
concurrent read-write/write-only transactions, create multiple sessions. Note that standalone
reads and queries use a transaction internally, and count toward the one transaction limit.
Active sessions use additional server resources, so it is a good idea to delete idle and
unneeded sessions. Aside from explicit deletes, Cloud Spanner may delete sessions for which no
operations are sent for more than an hour. If a session is deleted, requests to it return
NOT_FOUND
. Idle sessions can be kept alive by sending a trivial SQL query periodically, e.g.,
"SELECT 1"
.
Inheritance
Inherited Members
Namespace: Google.Apis.Spanner.v1
Assembly: Google.Apis.Spanner.v1.dll
Syntax
public class ProjectsResource.InstancesResource.DatabasesResource.SessionsResource.CreateRequest : SpannerBaseServiceRequest<Session>, IClientServiceRequest<Session>, IClientServiceRequest
Constructors
CreateRequest(IClientService, CreateSessionRequest, string)
Constructs a new Create request.
Declaration
public CreateRequest(IClientService service, CreateSessionRequest body, string database)
Parameters
Type | Name | Description |
---|---|---|
IClientService | service | |
CreateSessionRequest | body | |
string | database |
Properties
Database
Required. The database in which the new session is created.
Declaration
[RequestParameter("database", RequestParameterType.Path)]
public virtual string Database { get; }
Property Value
Type | Description |
---|---|
string |
HttpMethod
Gets the HTTP method.
Declaration
public override string HttpMethod { get; }
Property Value
Type | Description |
---|---|
string |
Overrides
MethodName
Gets the method name.
Declaration
public override string MethodName { get; }
Property Value
Type | Description |
---|---|
string |
Overrides
RestPath
Gets the REST path.
Declaration
public override string RestPath { get; }
Property Value
Type | Description |
---|---|
string |
Overrides
Methods
GetBody()
Returns the body of the request.
Declaration
protected override object GetBody()
Returns
Type | Description |
---|---|
object |
Overrides
InitParameters()
Initializes Create parameter list.
Declaration
protected override void InitParameters()