spanner: consider implementing long-running aka auto-refreshing Transaction #12
Labels
api: spanner
Issues related to the googleapis/python-spanner API.
priority: p2
Moderately-important priority. Fix may not be included in next release.
status: will not fix
Invalid (untrue/unsound/erroneous), inconsistent with product, not on roadmap.
type: feature request
‘Nice-to-have’ improvement, new feature or different behavior or design.
I understand that Cloud Spanner transactions are meant to be used for a short while and committed or rolled back and referring to the authoritative advisory at https://cloud.google.com/spanner/docs/reference/rest/v1/TransactionOptions#idle-transactions
which says
and for my purposes I need a transaction that'll potentially be held for long by a Python DBAPI v2 Cursor for an arbitrary period, so definitely it needs a refresh every 9 seconds to send
SELECT 1=1
I have prototyped a Transaction at https://gist.github.com/odeke-em/a17aa49854aeae1d83ffc14715f52d79In the midst of concurrency and usage with other threads, this becomes ridiculous to deal with because at times both might want to use any of the Transaction methods so the re-entrant locking being used with "shared memory".
However, this is so much work to use this library ontop of other errors that I feel like the barrier for entry could be reduced perhaps by an option implemented by this library so that I just have to do
or better yet every Transaction should be able to auto-refresh
The text was updated successfully, but these errors were encountered: