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;








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










share|improve this question
























  • 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

















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










share|improve this question
























  • 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













0












0








0


1






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










share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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

















  • 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












1 Answer
1






active

oldest

votes


















0














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.






share|improve this answer























  • Ok thanks a lot, Sir. Your answer is very meaningful for my project!

    – Moogy Moogy
    Mar 26 at 6:36










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
);



);













draft saved

draft discarded


















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









0














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.






share|improve this answer























  • Ok thanks a lot, Sir. Your answer is very meaningful for my project!

    – Moogy Moogy
    Mar 26 at 6:36















0














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.






share|improve this answer























  • Ok thanks a lot, Sir. Your answer is very meaningful for my project!

    – Moogy Moogy
    Mar 26 at 6:36













0












0








0







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.






share|improve this 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.







share|improve this answer












share|improve this answer



share|improve this 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

















  • 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








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.



















draft saved

draft discarded
















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현