Unfortunately the Datastore gives sometimes timeout exceptions on operations.
You can catch them and take some action, like retry the operation.
Or let the user know in a friendly manner.
There has been a post of a retry decorator on 25-aug-2009.

When you are wrapping your put() and get() operations in try-except
wrappers for Timeout exceptions, also do it for the CapabilityDisabled
exception in case the Datastore is in read-only mode during
maintenance.

2009/8/27 Nevin Freeman <nevin.free...@gmail.com>:
>
> I am getting the following traceback:
>
> Traceback (most recent call last):
>  File "/base/python_lib/versions/1/google/appengine/ext/webapp/
> __init__.py", line 507, in __call__
>    handler.get(*groups)
>  File "/base/data/home/apps/riabizdev/1.335829215948087052/
> handlers.py", line 197, in get
>    banner_code = models.Banner.get_by_id(int
> (banner_id)).get_code_and_log_impression()
>  File "/base/data/home/apps/riabizdev/1.335829215948087052/
> models.py", line 209, in get_code_and_log_impression
>    self.put()
>  File "/base/python_lib/versions/1/google/appengine/ext/db/
> __init__.py", line 725, in put
>    return datastore.Put(self._entity)
>  File "/base/python_lib/versions/1/google/appengine/api/
> datastore.py", line 166, in Put
>    raise _ToDatastoreError(err)
>  File "/base/python_lib/versions/1/google/appengine/api/
> datastore.py", line 2100, in _ToDatastoreError
>    raise errors[err.application_error](err.error_detail)
> Timeout
>
> And the method in question from models.py is this:
>
> def get_text(self):
>  self.counter += 1
>  self.put()                 #this is line 209, where the error
> originates
>  return self.text
>
>
> Is this a common problem that I can do something to avoid?
> Alternatively, could someone show me the syntax to make this fail
> gracefully? (I think I've seen an example before, but don't remember
> where to find it).
>
> Thanks in advance--
> Nevin Freeman
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to