Jeff, Thanks for the reply! You've really, really helped. I understand that a task will have to create a transaction and that it doesn't run in the context of the transaction that may have enqueued it. A re-phrasing of my question: Request 1 -> txn.begin() -> add entity "statistic" to "account" -> commit() ... where the commit enqueues the next request/task Request 2 (task) -> txn.begin() -> query "account" for all "statistics" -> txn.commit()
It sounds like what you're saying is that as long as "account" and "statistic" are in the same entity group, then I'll see the added person. If they're not in the same entity group, then it'll be eventually consistent, right? In our case, we're using JDO and the relationship between statistic and account is modeled as a "Key" field, but they aren't in the same entity group. In "Request 2" we simply query by kind "statistic" for all statistics with a filter for the current account. We don't get any error like "ancestor required in transaction". Last question: does the use of the transaction in Request 2 make any difference? As for our app, you can think of it as a finance app with credits and debits and statistics like "total spent", "average spent", etc. And we roll up stats so we have a hierarchy of summaries for different periods: weeks, months, years, all years. We currently kick off tasks to recalculate stat summaries whenever a credit or debit is added. Call it "near-realtime". When the user navigates to the "all-years" page we've likely recalculated the hierarchy of stat summaries. We don't really want to wait for them to request this page to go try and calculate all the summaries because it could be a long wait. I also wasn't too fond of having a cron job every minute looking for changes, but maybe that's what I need to do. Again, thanks. Stephen -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine/-/-3HZ8ZBcBGcJ. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
