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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:24:34+00:00 2026-05-23T03:24:34+00:00

I saw this sentence not only in one place: A transaction should be kept

  • 0

I saw this sentence not only in one place:

“A transaction should be kept as short as possible to avoid concurrency issues and to enable maximum number of positive commits.”

What does this really mean?

It puzzles me now because I want to use transactions for my app which in normal use will deal with inserting of hundreds of rows from many clients, concurrently.

For example, I have a service which exposes a method: AddObjects(List<Objects>) and of course these object contain other nested different objects.

I was thinking to start a transaction for each call from the client performing the appropriate actions (bunch of insert/update/delete for each object with their nested objects). EDIT1: I meant a transaction for entire “AddObjects” call in order to prevent undefined states/behaviour.

Am I going in the wrong direction? If yes, how would you do that and what are your recommendations?

EDIT2: Also, I understood that transactions are fast for bulk oeprations, but it contradicts somehow with the quoted sentence. What is the conclusion?

Thanks in advance!

  • 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-05-23T03:24:35+00:00Added an answer on May 23, 2026 at 3:24 am

    A transaction has to cover a business specific unit of work. It has nothing to do with generic ‘objects’, it must always be expressed in domain specific terms: ‘debit of account X and credit of account Y must be in a transaction’, ‘subtract of inventory item and sale must be in a transaction’ etc etc. Everything that must either succeed together or fail together must be in a transaction. If you are down an abstract path of ‘adding objects to a list is a transaction’ then yes, you are on a wrong path. The fact that all inserts/updates/deletes triggered by a an object save are in a transaction is not a purpose, but a side effect. The correct semantics should be ‘update of object X and update of object Y must be in a transaction’. Even a degenerate case of a single ‘object’ being updated should still be regarded in terms of domain specific terms.

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

Sidebar

Related Questions

Again, I saw this sentence: A .classpath file snippet that can be included in
I saw this magic in www.illuminat.org Rightnow, the site is not online. When a
I saw this question and some similar and I think it's not duplicate :
I saw a sentence in a paper Transforming branches into data dependencies to avoid
Saw this post yesterday: How I instantiate? Include code The user could not get
I saw this CSS pathname on one project I am working on and since
Saw this piece of code in a Ruby on Rails book. This first one
I saw this one in one of the .h files provided by my professor
I saw this used in a WWDC video but only very briefly. They didn't
I saw this as an example on MDN and didn't understand why this was

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.