Skip to content

Commit

Permalink
Don't pass transaction ID to connection.rollback_transaction().
Browse files Browse the repository at this point in the history
Feedback from @dhermes.
  • Loading branch information
tseaver committed Sep 25, 2014
1 parent 4720557 commit d576000
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions gcloud/datastore/test_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def test_rollback(self):
xact.begin()
xact.rollback()
self.assertEqual(xact.id(), None)
self.assertEqual(connection._rolled_back, (_DATASET, 234))
self.assertEqual(connection._rolled_back, _DATASET)
self.assertEqual(connection._xact, None)

def test_commit_no_auto_ids(self):
Expand Down Expand Up @@ -127,7 +127,7 @@ class Foo(Exception):
except Foo:
pass # XXX
#self.assertEqual(xact.id(), None)
#self.assertEqual(connection._rolled_back, (_DATASET, 234))
#self.assertEqual(connection._rolled_back, _DATASET))
#self.assertEqual(connection._xact, None)
# XXX should *not* have committed
self.assertEqual(connection._committed, (_DATASET, mutation))
Expand Down Expand Up @@ -167,8 +167,8 @@ def transaction(self, xact=_marker):
def begin_transaction(self, dataset_id):
self._begun = dataset_id
return self._xact_id
def rollback_transaction(self, dataset_id, xact_id):
self._rolled_back = (dataset_id, xact_id)
def rollback_transaction(self, dataset_id):
self._rolled_back = dataset_id
def commit(self, dataset_id, mutation):
self._committed = (dataset_id, mutation)
return self._commit_result
Expand Down
2 changes: 1 addition & 1 deletion gcloud/datastore/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def rollback(self):
- Sets the current connection's transaction reference to None.
- Sets the current transaction's ID to None.
"""
self.connection().rollback_transaction(self.dataset().id(), self.id())
self.connection().rollback_transaction(self.dataset().id())
self.connection().transaction(None)
self._id = None

Expand Down

0 comments on commit d576000

Please sign in to comment.