Title: DISCUSSION: Does a Transaction need to be bound to a Connection and vice versa · Issue #495 · googleapis/google-cloud-python · GitHub
Open Graph Title: DISCUSSION: Does a Transaction need to be bound to a Connection and vice versa · Issue #495 · googleapis/google-cloud-python
X Title: DISCUSSION: Does a Transaction need to be bound to a Connection and vice versa · Issue #495 · googleapis/google-cloud-python
Description: It seems we could have connection=None as an optional / implicit argument in the Transaction methods add_auto_id_entity(), begin(), commit() and rollback(). On Connection, the current transaction is used to alter the behavior of the meth...
Open Graph Description: It seems we could have connection=None as an optional / implicit argument in the Transaction methods add_auto_id_entity(), begin(), commit() and rollback(). On Connection, the current transaction i...
X Description: It seems we could have connection=None as an optional / implicit argument in the Transaction methods add_auto_id_entity(), begin(), commit() and rollback(). On Connection, the current transaction i...
Opengraph URL: https://github.com/googleapis/google-cloud-python/issues/495
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"DISCUSSION: Does a Transaction need to be bound to a Connection and vice versa","articleBody":"It seems we could have `connection=None` as an optional / implicit argument in the `Transaction` methods `add_auto_id_entity()`, `begin()`, `commit()` and `rollback()`.\n\nOn `Connection`, the current transaction is used to alter the behavior of the methods, e.g. from [`commit()`](https://github.com/GoogleCloudPlatform/gcloud-python/blob/8faba35a266cd6280f125adf6035f902a07a26e4/gcloud/datastore/connection.py#L359-L363)\n\n``` python\n if self.transaction():\n request.mode = datastore_pb.CommitRequest.TRANSACTIONAL\n request.transaction = self.transaction().id()\n else:\n request.mode = datastore_pb.CommitRequest.NON_TRANSACTIONAL\n```\n\nIt seems instead this separation would benefit by having `Transaction` subclass `Connection` and adding the \"extra\" transaction parts when needed.\n","author":{"url":"https://github.com/dhermes","@type":"Person","name":"dhermes"},"datePublished":"2015-01-07T03:21:20.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/495/google-cloud-python/issues/495"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:8eedec5d-64a0-e706-a242-8d7b7734f34f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E558:34DA5A:135BEF5:1A7AC0F:6A4EFC5C |
| html-safe-nonce | 0d32c8af18d2e6da188dc801517eb5aa6f9f68cdf28ac2625083574460df3913 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNTU4OjM0REE1QToxMzVCRUY1OjFBN0FDMEY6NkE0RUZDNUMiLCJ2aXNpdG9yX2lkIjoiNDgwNDI0ODM1MzQ4NjMzOTE2NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 0eb04f12514f1bb8cc826b43a1f4a8fbfc90be511e10af63b5e23516c86e8dc7 |
| hovercard-subject-tag | issue:53593199 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/googleapis/google-cloud-python/495/issue_layout |
| twitter:image | https://opengraph.githubassets.com/39cf82c7d24f6bfeba17dc2a12098967d47fdf601233527dac89927d49fefe6a/googleapis/google-cloud-python/issues/495 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/39cf82c7d24f6bfeba17dc2a12098967d47fdf601233527dac89927d49fefe6a/googleapis/google-cloud-python/issues/495 |
| og:image:alt | It seems we could have connection=None as an optional / implicit argument in the Transaction methods add_auto_id_entity(), begin(), commit() and rollback(). On Connection, the current transaction i... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dhermes |
| hostname | github.com |
| expected-hostname | github.com |
| None | b92d11c0aa4a77d54ef4af1078b6a15fb5a70a215b30c4ecf28889d5a8e656d9 |
| turbo-cache-control | no-preview |
| go-import | github.com/googleapis/google-cloud-python git https://github.com/googleapis/google-cloud-python.git |
| octolytics-dimension-user_id | 16785467 |
| octolytics-dimension-user_login | googleapis |
| octolytics-dimension-repository_id | 16316451 |
| octolytics-dimension-repository_nwo | googleapis/google-cloud-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 16316451 |
| octolytics-dimension-repository_network_root_nwo | googleapis/google-cloud-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2b8f23afb982271f1b22258a94aede67a6b77760 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width