Use db.non_transactional in datastore code.
Fixes issue #318
diff --git a/oauth2client/appengine.py b/oauth2client/appengine.py
index a001350..799e063 100644
--- a/oauth2client/appengine.py
+++ b/oauth2client/appengine.py
@@ -434,6 +434,7 @@
entity_key = db.Key.from_path(self._model.kind(), self._key_name)
db.delete(entity_key)
+ @db.non_transactional(allow_existing=True)
def locked_get(self):
"""Retrieve Credential from datastore.
@@ -456,6 +457,7 @@
credentials.set_store(self)
return credentials
+ @db.non_transactional(allow_existing=True)
def locked_put(self, credentials):
"""Write a Credentials to the datastore.
@@ -468,6 +470,7 @@
if self._cache:
self._cache.set(self._key_name, credentials.to_json())
+ @db.non_transactional(allow_existing=True)
def locked_delete(self):
"""Delete Credential from datastore."""