Node.js · Middle · Question 48 of 75
When do you need a database transaction?
- ✓Correct answer: When several changes must succeed or fail together, like moving money between two accounts
- 2For every SELECT query
- 3Only when using MongoDB
Explanation
Use the same connection for every statement in the transaction and roll back on any error.