-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
api: datastoreIssues related to the Datastore API.Issues related to the Datastore API.type: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.
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 methods, e.g. from commit()
if self.transaction():
request.mode = datastore_pb.CommitRequest.TRANSACTIONAL
request.transaction = self.transaction().id()
else:
request.mode = datastore_pb.CommitRequest.NON_TRANSACTIONALIt seems instead this separation would benefit by having Transaction subclass Connection and adding the "extra" transaction parts when needed.
Metadata
Metadata
Assignees
Labels
api: datastoreIssues related to the Datastore API.Issues related to the Datastore API.type: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.