The model is very simple here.
class table(db.Model)
    atime=db.DateTimeProperty(auto_now=True)
    data=db.BlobProperty()

I want to have function simply delete data older than a certain time.

Is it safe to use just

db.delete(table.all().filter('atime <', expire_time).fetch(100))

or do I have to do it like this

def txn():
    old = table.all().filter('atime <', expire_time).get()
    if old is not None:
        old.delete()
        return True
    return False
while run_in_transaction(txn): pass

My concern is that the first method may delete an entry is being
updated. The second method seems very inefficient.
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to