This repository has been archived by the owner on Dec 8, 2021. It is now read-only.
Sessions must only execute one Transaction at a time #464
Labels
api: spanner
Issues related to the googleapis/google-cloud-cpp-spanner API.
priority: p1
Medium priority. Will be fixed prior to next release.
🚨
This issue needs some love.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Milestone
Sessions can only execute one transaction at a time (as stated here and elsewhere). However, our current implementation does not ensure that. For each operation (call on
Client
), theConnectionImpl
takes aSession
from the pool, makes the RPC, then returns theSession
to the pool. The pool re-usesSession
s in LIFO order. So, as long as the calls to theConnectionImpl
use the sameTransaction
repeatedly, we will get the sameSession
, but in a multi-threaded program that may not be the case.The text was updated successfully, but these errors were encountered: