I had a similar problem with one of my apps.

I solved it by using @db.transactional

e.g.

@db.transactional
def update_program(program_data):
    # Using transactional to ensure that DB is consistent before displaying
programs again
    program_data.put()

Then, whenever I need to update program_data before redirecting to a page,
call update_program(program_data) where program_data is a reference to a
db.Model instance

Hope this helps,

Julie



On 20 April 2013 04:11, Vinny P <[email protected]> wrote:

>
> On Thursday, April 18, 2013 1:27:00 AM UTC-5, Nijin Narayanan wrote:
>>
>> The Page is redirecting after the datastore operation performed.
>> Something like this:
>>
>> db.delete(key)
>>
>> self.redirect(new_page)
>>
>> Does this will redirect the page before completing the delete operation ?
>>
>>
> The answer is a resounding and firm "Maybe".
>
> Operations on the datastore take place in two parts: the commit phase, and
> the apply phase. You can read more about it at
> https://developers.google.com/appengine/docs/python/datastore/overview#Datastore_Writes_and_Data_Visibility
>  but
> the short version is that datastore operations return after the commit
> phase, not after the apply phase. You may have told the datastore to delete
> an object, but it'll take some milliseconds for that operation to execute
> even after the delete op has returned.
>
> You might need to add an artificial delay to your code, or manually
> account for its' deletion.
>
>
> -----------------
> -Vinny P
> Technology & Media Advisor
> Chicago, IL
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/google-appengine?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-appengine?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to