-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
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?