8000 Spanner: Better document the difference between singleUse() and singleUseReadOnlyTransaction(). · Issue #4212 · googleapis/google-cloud-java · GitHub
[go: up one dir, main page]

Skip to content

Spanner: Better document the difference between singleUse() and singleUseReadOnlyTransaction(). #4212

@dopiera

Description

@dopiera

Hi,
I think the documentation of the difference between DatabaseClient.singleUse() and DatabaseClient.singleUseReadOnlyTransaction() needs to be more verbose.

This is the documentation for both of these:

Returns a context in which a single read can be performed using TimestampBound.strong() concurrency.

Returns a read-only transaction context in which a single read or query can be performed using TimestampBound.strong() concurrency.

By looking at the code, the only difference I can really find is that ReadOnlyTransaction (returned by singleUseReadOnlyTransaction()) holds the read_timestamp selected internally by Spanner once the Read or query finishes. If I'm reading it correctly, that means that singleUse() is not less transactional than singleUseReadOnlyTransaction() is. Is there any reason (beyond compatibility) not to remove singleUse() from the DatabaseClient?

Metadata

Metadata

Assignees

Labels

api: spannerIssues related to the Spanner API.type: docsImprovement to the documentation for an API.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0