I have seen this offer not only in one place:
"The transaction should be as short as possible to avoid concurrency issues and include the maximum number of positive commits."
What does it mean?
Now it puzzles me, because I want to use transactions for my application, which in normal mode will deal with inserting hundreds of rows from many clients at the same time.
For example, I have a service that provides a method: AddObjects(List<Objects>)and, of course, this object contains other nested different objects.
I was thinking of starting a transaction for each call from the client performing the corresponding actions (insert / update / delete link for each object with their nested objects). EDIT1: I was referring to a transaction to fully invoke " AddObjects" to prevent undefined states / behavior.
Am I going in the wrong direction? If so, how do you do it and what are your recommendations?
EDIT2: In addition, I realized that transactions are fast for mass companies, but it somehow contradicts the quoted offer. What is the conclusion?
Thanks in advance!
source
share