Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8189961
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T03:27:35+00:00 2026-06-07T03:27:35+00:00

I created a test web application to test persist-read-delete of Entities , I created

  • 0

I created a test web application to test persist-read-delete of Entities, I created a simple loop to persist an Entity, retrieve and modify it then delete it for 100 times.

At some interval of the loop there’s no problem, however there are intervals that there is an error that Entity already exist and thus can’t be persisted (a custom exception handling I added).

Also at some interval of the loop, the Entity can’t be modified because it does not exist, and finally at some interval the Entity can’t be deleted because it does not exist.

I understand that the loop may be so fast that the operation to the Appengine datastore is not yet complete. Thus causing, errors like Entity does not exist, when trying to access it or the delete operation is not yet finished so creating an Entity with the same ID can’t be created yet and so forth.

However, I want to understand how to handle these kind of situation where concurrent operation is being done with a Entity.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T03:27:37+00:00Added an answer on June 7, 2026 at 3:27 am

    From what I understand you are doings something like the following:

    for i in range(0,100):
        ent = My_Entity()    # create and save entity
        db.put(ent)
        ent = db.get(ent.key())   # get, modify and save the entity
        ent.property = 'foo'
        db.put(ent)
        ent.get(ent.key())  # get and delete the entity
        db.delete(my_ent)
    

    with some error checking to make sure you have entities to delete, modify, and you are running into a bunch of errors about finding the entity to delete or modify. As you say, this is because the calls aren’t guaranteed to be executed in order.

    However, I want to understand how to handle these kind of situation where concurrent operation is being done with a Entity.

    You’re best bet for this is to batch any modifications you are doing for an entity persisting. For example if you are going to be creating/saving/modifying/savings or modifying/saving/deleting where ever possible try to combine these steps (ie create/modify/save or modify/delete). Not only will this avoid the errors you’re seeing but it will also cut down on your RPCs. Following this strategy the above loop would be reduced to…

    prop = None
    for i in range(0,100):
        prop = 'foo'
    

    Put in other words, for anything that requires setting/deleting that quickly just use a local variable. That’s GAE’s answer for you. After you figure out all the quick stuff you can’t persist that information in an entity.

    Other than that there isn’t much you can do. Transactions can help you if you need to make sure a bunch of entities are updated together but won’t help if you’re trying to multiple things to one entity at once.

    EDIT: You could also look at the pipelines API.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created small test web application which makes use of LINQ to SQL.
I created an error500.php file in web/errors/ and would now like to test it.
I created a test application that generates 10k random numbers in a range from
I have my new macbook air. I have created one test application. now i
I created a simple test page on my website www.xaisoft.com and it had no
I created a simple test with SendKeys, and tried both SendWait and Send. Private
Hello gud fellas in my quest of learning spring, i created a web application
I have created an ASP.NET application on my local machine. In order to test
I am currently trying to test some code I have in a web application
I'm wondering how the concurrency in a web application actually works. Ive read several

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.