Hi @Kashifa_khan and welcome in the MongoDB Community
!
Yes, transactions are automatically retried ONCE if they fail because of a transient network error.
Same for all the write operations actually if you didn’t disable the retryWrites and same for the read operations.
The result of write conflicts in transaction depends on the lock. See the docs here: https://docs.mongodb.com/manual/core/transactions-production-consideration/#in-progress-transactions-and-write-conflicts.
In any case, for any MongoDB query, you are always supposed to handle the potential errors or exceptions that these functions can raise. If your cluster go down, you will timeout on all the queries and hopefully this shouldn’t take down the back end with it entirely. And even if a query is retried (read or writes) once, it has to answer before the timeout time you have set.
Cheers,
Maxime.