最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

javascript - Do firestore batch writes get re-run automatically on failure? - Stack Overflow

matteradmin9PV0评论

While going through the official documentation I found out that transactions are automatically re-run a finite number of times by the SDK on failure, however in case of Batch Writes it is not explicitly mentioned.

The documentation does mention that batch writes are atomic just like transactions but that does not necessarily implies that they get re-run also on failure.

While going through the official documentation I found out that transactions are automatically re-run a finite number of times by the SDK on failure, however in case of Batch Writes it is not explicitly mentioned.

The documentation does mention that batch writes are atomic just like transactions but that does not necessarily implies that they get re-run also on failure.

Share Improve this question asked May 27, 2019 at 19:10 Maaz Bin KhawarMaaz Bin Khawar 4603 silver badges13 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 8

Batch writes are not retried if there is a failure. The entire thing is just rolled back, and you have to figure out for yourself if you want to retry.

Transactions are retried because they are explicitly trying to make a change based on the contents of existing document. Since those documents could change between the round trip between the client and server, the retry is necessary to automatically handle that case, if it happens. Batch writes don't have this problem, since they are atomic, but not really transactional in nature.

Post a comment

comment list (0)

  1. No comments so far