This repository has been archived by the owner on Dec 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Move session_name out of the Connection *Param structs #445
Labels
api: spanner
Issues related to the googleapis/google-cloud-cpp-spanner API.
type: cleanup
An internal cleanup or hygiene concern.
Milestone
Comments
mr-salty
added a commit
that referenced
this issue
Aug 28, 2019
mr-salty
added a commit
that referenced
this issue
Aug 28, 2019
`Transaction` now has a `SessionHolder` which is populated on-demand during the first operation involving that `Transaction`. The session is (normally) returned to the pool it was allocated from when the `Transaction` is destroyed, but in the interim it will not be used by any other `Transaction`. - `Transaction::Visit` passes a reference to its `SessionHolder` to its functor. These are usually `ConnectionImpl` methods, which now use the session a `Transaction` already holds, or get a new session from the pool if needed. - For Partition Read/Query cases: - Allow constructing a `Transaction` with session and transaction IDs. - Remove session from *Params structs (fixes #445). - Partitioned `Transactions` do not return their sessions to the pool, nor do the `PartitionRead` or `PartitionQuery` operations that created them. - Update tests; add a matcher to check the `Transaction` session and transaction IDs. Fixes #464 Fixes #445
devjgm
pushed a commit
to devjgm/google-cloud-cpp
that referenced
this issue
May 7, 2020
devjgm
pushed a commit
to devjgm/google-cloud-cpp
that referenced
this issue
May 7, 2020
…ud-cpp-spanner#465) `Transaction` now has a `SessionHolder` which is populated on-demand during the first operation involving that `Transaction`. The session is (normally) returned to the pool it was allocated from when the `Transaction` is destroyed, but in the interim it will not be used by any other `Transaction`. - `Transaction::Visit` passes a reference to its `SessionHolder` to its functor. These are usually `ConnectionImpl` methods, which now use the session a `Transaction` already holds, or get a new session from the pool if needed. - For Partition Read/Query cases: - Allow constructing a `Transaction` with session and transaction IDs. - Remove session from *Params structs (fixes googleapis/google-cloud-cpp-spanner#445). - Partitioned `Transactions` do not return their sessions to the pool, nor do the `PartitionRead` or `PartitionQuery` operations that created them. - Update tests; add a matcher to check the `Transaction` session and transaction IDs. Fixes googleapis/google-cloud-cpp-spanner#464 Fixes googleapis/google-cloud-cpp-spanner#445
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
api: spanner
Issues related to the googleapis/google-cloud-cpp-spanner API.
type: cleanup
An internal cleanup or hygiene concern.
We do not want to expose
session_name
in the*Params
structs that are defined in connection.h, so we need to move the session_name out into some other place.From discussions here, it seems that the leading option is to move the
session_name
string into theTransaction
object itself.@devbww has other ideas too.
Moving it anywhere out of our public API and into an implementation detail SGTM.
The text was updated successfully, but these errors were encountered: