タスク Task -- http://code.google.com/intl/ja/appengine/docs/python/taskqueue/overview.html
-http://groups.google.com/group/google-app-engine-japan/browse_thread/thread/28207f93c7f5b8ed/739d66ec553412e0?lnk=gst&q=1,000#739d66ec553412e0
http://code.google.com/intl/ja/appengine/docs/python/datastore/queriesandindexes.html#Queries_on_Keys
やはり追加テーブルとのトランザクションはできない
けれども、子孫となるテーブルにすればできないこともない
key_name ="http://pages.google.com/edit/kwin786/Impressionnism01_s.jpg-2"
r = db.get(db.Key.from_path('Imgmap',key_name))
db.run_in_transaction(update_imgmap,r.key())
def update_imgmap(key):
r = db.get(key)
r.regimgmapcontenturl = "1"
s = ImgmapContentUrl(
key_name=r.content_url,
# parent=key,
content_url = r.content_url)
s.put()
r.put()
Traceback (most recent call last): File "C:\Program Files\Google\google_appengine\google\appengine\ext\webapp\__init__.py", line 507, in __call__ handler.get(*groups) File "C:\google\museum-in-cloud\cron.py", line 70, in get db.run_in_transaction(update_imgmap,r.key()) File "C:\Program Files\Google\google_appengine\google\appengine\api\datastore.py", line 1904, in RunInTransaction DEFAULT_TRANSACTION_RETRIES, function, *args, **kwargs) File "C:\Program Files\Google\google_appengine\google\appengine\api\datastore.py", line 2001, in RunInTransactionCustomRetries result = function(*args, **kwargs) File "C:\google\museum-in-cloud\cron.py", line 148, in update_imgmap s.put() File "C:\Program Files\Google\google_appengine\google\appengine\ext\db\__init__.py", line 797, in put return datastore.Put(self._entity) File "C:\Program Files\Google\google_appengine\google\appengine\api\datastore.py", line 198, in Put tx = _MaybeSetupTransaction(req, keys) File "C:\Program Files\Google\google_appengine\google\appengine\api\datastore.py", line 2090, in _MaybeSetupTransaction raise _DifferentEntityGroupError(expected_group, group) File "C:\Program Files\Google\google_appengine\google\appengine\api\datastore.py", line 2122, in _DifferentEntityGroupError b.kind(), id_or_name(b))) BadRequestError: Cannot operate on different entity groups in a transaction: (kind=u'Imgmap', name=u'http://pages.google.com/edit/kwin786/Impressionnism01_s.jpg-2') and (kind=u'ImgmapContentUrl', name=u'http://pages.google.com/edit/kwin786/Impressionnism01_s.jpg').