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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T10:51:16+00:00 2026-06-09T10:51:16+00:00

If I want all deletes execute all-or-nothing. If nothing changed. Will the group of

  • 0

If I want all deletes execute all-or-nothing.

  1. If nothing changed. Will the group of deletes be atomic?
  2. If I remove outer transaction, will something change?
  3. If I remove only inner transaction, will group be atomic?
  4. Ig I replace for-cycle with a batch delete and leave only outer transaction?

    // inside event plan dao
    public void delete(EventPlan eventPlan) {
      final Objectify ofy = Objectify.beginTransaction();
      try {
        final ActivityDAO activityDao = new ActivityDAO();
        for (final Activity activity : eventPlan.getActivities()) {
          activityDao.delete(activity);
        }
        ofy.getTxn().commit();
      } finally {
        if (ofy.getTxn().isActive()) {
          ofy.getTxn().rollback();
        |
      }
    }

   

    // inside activity dao
    public void delete(Activity activity) {
          final Objectify ofy = Objectify.beginTransaction();
       try {
          // do some logic in here, delete activity and commit txn
       } finally {
          // check and rollback as normal
       }
    }

  • 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-09T10:51:17+00:00Added an answer on June 9, 2026 at 10:51 am

    If you use Objectify 3.1 then all transactions are XG-transactions, which can operate on max 5 different entity groups, i.e. if your Activities do not have common parent (= putting them in the same entity group) then you can only delete max five in one transaction.

    1. No, you are using parallel transactions ( one outer, multiple inner).
    2. No, outer transaction has no operation executed, so it does nothing. There are multiple inner transaction (loop) each doing it’s own delete.
    3. Yes, you must perform all operations within one transaction for operations to be atomic. If you remove inner transactions you are on the right path. However, Entity Group transaction limit still applies: all entities touched within a transaction must belong to the same Entity Group, or (since XG is enabled by default) to max five different Entity Groups (see above). Note if you don’t explicitly put entity in Entity Group (by setting parent) then every entity gets it’s own Entity Group.
    4. Yes, batch delete is better then delete in loop (due to efficiency) but all transaction rules in point 3. still apply.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to build a python program that deletes all the photos from my
I want to delete all rows in a datatable. I use something like this:
I have some partitions on /dev/sda. I want to remove them all of them
I want to execute ANT delete target, so that I can delete all files
I want to delete all files in a directory with a given name, except
I want to delete all subdirectories and files from a directory, but not the
I want to delete all the elements from my list: foreach (Session session in
I want to delete all predicates named a from the list. The result must
Hi I want to delete all stuff related to rails generate scaffold at once.
I have a html document and I want to delete all the divs of

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.