Different use Transaction and use add to FirestoreLimitations on Cloud Firestore transactionsFirestore transaction with multiple getFirestore - multiple add and update operations in one transactionFireStore Transaction: Transaction is not being atomichow to add or remove item to the the existing array in firestore ?Updating Multipath Firestore Data With TransactionsUpdate multiple documents in a single transaction with dart and Firestorehow to add an image into FirestoreFlutter/Firebase Firestore using runTransaction do nothingCan Firestore Transactions Be Batched?
Cubic programming and beyond?
Password maker in c#
During copyediting, journal disagrees about spelling of paper's main topic
Extract an attribute value from XML
Did any of the founding fathers anticipate Lysander Spooner's criticism of the constitution?
Redirect https to fqdn
What's the point of this scene involving Flash Thompson at the airport?
Optimising Table wrapping over a Select
What's the fastest way to get Hard To Borrow (HTB) stocks?
I quit, and boss offered me 3 month "grace period" where I could still come back
Why does the autopilot disengage even when it does not receive pilot input?
How to check the quality of an audio sample?
Why does Hellboy file down his horns?
Is this floating-point optimization allowed?
Is Trump personally blocking people on Twitter?
Where or how can I find what interfaces an out of the box Apex class implements?
What would be the ideal melee weapon made of "Phase Metal"?
Was the Ford Model T black because of the speed black paint dries?
What is the difference between logical consistency and logical entailment in deductive logic?
Why does resistance reduce when a conductive fabric is stretched?
The monorail explodes before I can get on it
How did the hit man miss?
Is there a way to perform "if" check only once instead of every iteration in a loop?
How can an advanced civilization forget how to manufacture its technology?
Different use Transaction and use add to Firestore
Limitations on Cloud Firestore transactionsFirestore transaction with multiple getFirestore - multiple add and update operations in one transactionFireStore Transaction: Transaction is not being atomichow to add or remove item to the the existing array in firestore ?Updating Multipath Firestore Data With TransactionsUpdate multiple documents in a single transaction with dart and Firestorehow to add an image into FirestoreFlutter/Firebase Firestore using runTransaction do nothingCan Firestore Transactions Be Batched?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
What's the difference when we use add data to firestore and use Transaction? I still don't understand this use. because he produces the same value. thanks
flutter google-cloud-firestore
add a comment |
What's the difference when we use add data to firestore and use Transaction? I still don't understand this use. because he produces the same value. thanks
flutter google-cloud-firestore
A transaction is only needed when you have multiple documents to change, and those changes must all be made at the same time, all in sync with each other. A single document add with a unique ID doesn't need a transaction.
– Doug Stevenson
Mar 26 at 5:53
ok thank you sir!
– Moogy Moogy
Mar 26 at 6:32
add a comment |
What's the difference when we use add data to firestore and use Transaction? I still don't understand this use. because he produces the same value. thanks
flutter google-cloud-firestore
What's the difference when we use add data to firestore and use Transaction? I still don't understand this use. because he produces the same value. thanks
flutter google-cloud-firestore
flutter google-cloud-firestore
edited Mar 26 at 20:29
marc_s
596k135 gold badges1145 silver badges1283 bronze badges
596k135 gold badges1145 silver badges1283 bronze badges
asked Mar 26 at 4:38
Moogy MoogyMoogy Moogy
34 bronze badges
34 bronze badges
A transaction is only needed when you have multiple documents to change, and those changes must all be made at the same time, all in sync with each other. A single document add with a unique ID doesn't need a transaction.
– Doug Stevenson
Mar 26 at 5:53
ok thank you sir!
– Moogy Moogy
Mar 26 at 6:32
add a comment |
A transaction is only needed when you have multiple documents to change, and those changes must all be made at the same time, all in sync with each other. A single document add with a unique ID doesn't need a transaction.
– Doug Stevenson
Mar 26 at 5:53
ok thank you sir!
– Moogy Moogy
Mar 26 at 6:32
A transaction is only needed when you have multiple documents to change, and those changes must all be made at the same time, all in sync with each other. A single document add with a unique ID doesn't need a transaction.
– Doug Stevenson
Mar 26 at 5:53
A transaction is only needed when you have multiple documents to change, and those changes must all be made at the same time, all in sync with each other. A single document add with a unique ID doesn't need a transaction.
– Doug Stevenson
Mar 26 at 5:53
ok thank you sir!
– Moogy Moogy
Mar 26 at 6:32
ok thank you sir!
– Moogy Moogy
Mar 26 at 6:32
add a comment |
1 Answer
1
active
oldest
votes
In one word I'll say we do this to beware from Race Condition.
What is a Race Condition?
A race condition is an undesirable situation that occurs when a device or system attempts to perform two or more operations at the same time, but because of the nature of the device or system, the operations must be done in the proper sequence to be done correctly
Let me give you an example
Suppose you are activating the user account.
To activate the user account you will go to the database and flip the value (false
to true
). At that same time, some else is also trying to activate the account they will also flip the value ( true
to false
).
Just to beware from these kinds of thing we use transition. Before performing any change in the database we read the data and confirm.
If you did not satisfy from my answer then do read about Race Condition
because that is the exact answer.
Ok thanks a lot, Sir. Your answer is very meaningful for my project!
– Moogy Moogy
Mar 26 at 6:36
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55349949%2fdifferent-use-transaction-and-use-add-to-firestore%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
In one word I'll say we do this to beware from Race Condition.
What is a Race Condition?
A race condition is an undesirable situation that occurs when a device or system attempts to perform two or more operations at the same time, but because of the nature of the device or system, the operations must be done in the proper sequence to be done correctly
Let me give you an example
Suppose you are activating the user account.
To activate the user account you will go to the database and flip the value (false
to true
). At that same time, some else is also trying to activate the account they will also flip the value ( true
to false
).
Just to beware from these kinds of thing we use transition. Before performing any change in the database we read the data and confirm.
If you did not satisfy from my answer then do read about Race Condition
because that is the exact answer.
Ok thanks a lot, Sir. Your answer is very meaningful for my project!
– Moogy Moogy
Mar 26 at 6:36
add a comment |
In one word I'll say we do this to beware from Race Condition.
What is a Race Condition?
A race condition is an undesirable situation that occurs when a device or system attempts to perform two or more operations at the same time, but because of the nature of the device or system, the operations must be done in the proper sequence to be done correctly
Let me give you an example
Suppose you are activating the user account.
To activate the user account you will go to the database and flip the value (false
to true
). At that same time, some else is also trying to activate the account they will also flip the value ( true
to false
).
Just to beware from these kinds of thing we use transition. Before performing any change in the database we read the data and confirm.
If you did not satisfy from my answer then do read about Race Condition
because that is the exact answer.
Ok thanks a lot, Sir. Your answer is very meaningful for my project!
– Moogy Moogy
Mar 26 at 6:36
add a comment |
In one word I'll say we do this to beware from Race Condition.
What is a Race Condition?
A race condition is an undesirable situation that occurs when a device or system attempts to perform two or more operations at the same time, but because of the nature of the device or system, the operations must be done in the proper sequence to be done correctly
Let me give you an example
Suppose you are activating the user account.
To activate the user account you will go to the database and flip the value (false
to true
). At that same time, some else is also trying to activate the account they will also flip the value ( true
to false
).
Just to beware from these kinds of thing we use transition. Before performing any change in the database we read the data and confirm.
If you did not satisfy from my answer then do read about Race Condition
because that is the exact answer.
In one word I'll say we do this to beware from Race Condition.
What is a Race Condition?
A race condition is an undesirable situation that occurs when a device or system attempts to perform two or more operations at the same time, but because of the nature of the device or system, the operations must be done in the proper sequence to be done correctly
Let me give you an example
Suppose you are activating the user account.
To activate the user account you will go to the database and flip the value (false
to true
). At that same time, some else is also trying to activate the account they will also flip the value ( true
to false
).
Just to beware from these kinds of thing we use transition. Before performing any change in the database we read the data and confirm.
If you did not satisfy from my answer then do read about Race Condition
because that is the exact answer.
answered Mar 26 at 4:58
nitishk72nitishk72
5914 silver badges17 bronze badges
5914 silver badges17 bronze badges
Ok thanks a lot, Sir. Your answer is very meaningful for my project!
– Moogy Moogy
Mar 26 at 6:36
add a comment |
Ok thanks a lot, Sir. Your answer is very meaningful for my project!
– Moogy Moogy
Mar 26 at 6:36
Ok thanks a lot, Sir. Your answer is very meaningful for my project!
– Moogy Moogy
Mar 26 at 6:36
Ok thanks a lot, Sir. Your answer is very meaningful for my project!
– Moogy Moogy
Mar 26 at 6:36
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55349949%2fdifferent-use-transaction-and-use-add-to-firestore%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
A transaction is only needed when you have multiple documents to change, and those changes must all be made at the same time, all in sync with each other. A single document add with a unique ID doesn't need a transaction.
– Doug Stevenson
Mar 26 at 5:53
ok thank you sir!
– Moogy Moogy
Mar 26 at 6:32