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 8198665
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:59:50+00:00 2026-06-07T05:59:50+00:00

I have a similar code below that I’m trying to figure out transaction locking:

  • 0

I have a similar code below that I’m trying to figure out transaction locking:

DAOT.repeatInTransaction(new Transactable() {
        @Override
        public void run(DAOT daot)
        {
                Points points = daot.ofy().find(Points.class, POINTS_ID);
                // do something with points
                takes_a_very_long_time_delay(); // perhaps 10 secs
                daot.ofy().put(points);
        }
});

The code above is executed from within a Java servlet. The operation is expected to work for 10 seconds for example. In between that time, I have a test that will invoke another servlet that will delete a Points entity, I was expecting that the delete operation would fail or at least delete the entity after the transaction above has finished.

However the entity was deleted during the period that the above code is executing. In my real application, I added exception handling to throw exception when trying to access or edit a entity that does not exist.

From there, the application is throwing “Entity not found" exception just after I executed the servlet that will delete the Entity in the code above.

Although I am using GAE Transactions already, however I think I am still missing something that’s why my test fails.

Code for the delete Transaction from withing the Delete servlet:

DAOT.repeatInTransaction(new Transactable() {
        @Override
        public void run(DAOT daot)
        {
                Points points = daot.ofy().find(Points.class, POINTS_ID);
                daot.ofy().delete(points);
        }
});

How can I ensure that a new operation like a delete for a entity will wait until the current operation is happening on a entity during a transaction?

  • 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-07T05:59:51+00:00Added an answer on June 7, 2026 at 5:59 am

    App Engine uses optimistic concurrency, not locking. That is, a transaction on a group of entities will not prevent other processes from modifying those entities while the transaction runs. Instead, when the transaction attempts to commit, it will check if any modifications were made while the transaction was executing, and if it has, discard any changes and run your function again from the beginning.

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

Sidebar

Related Questions

I have a piece of code similar to the below that I have been
We have code similar to the one below. We are trying to achieve RAII
I have a code snippet similar to the one below that I would like
I am maintaining several Perl scripts that all have similar code blocks for different
I have code similar to this: public List<string> Expected = new List<string>(); public int
In a CUDA kernel, I have code similar to the following. I am trying
I have a large JSON file that contains A LOT of similar code. It's
Requirement : I have a piece of code similar to the code below. I
I have a multi-dimensional array similar to the example below that I want to
I have a class template similar to the one that follows below that is

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.