With Change sets, you can bundle different operations to one atomic transaction which then either succeeds or fails as a whole. This results in a rollback of all bundled actions, if any of the transactions failed.
An atomic transaction is a series of database operations that are executed as a single, indivisible unit of work. In other words, they are a group of operations that are executed together, and if any one of them fails, the whole transaction is rolled back to its initial state, and none of the changes made during the transaction are committed to the database.
The key feature of an atomic transaction is that it guarantees that either all the operations are completed successfully or none of them are. This is called „atomicity“, which means indivisibility or indivisible.
Atomic transactions are used to ensure the consistency and integrity of a database by allowing multiple operations to be executed as a single, all-or-nothing unit of work. They are widely used in database systems, distributed systems, and other applications that require strong consistency guarantees.
For Example, a banking application that needs to transfer money from one account to another needs an atomic transaction. If the transfer operation isn’t atomic, it could result in a situation where the funds are debited from the first account but not credited to the second account. The funds would then be lost. Using an atomic transaction, either the funds are transferred successfully or the transaction is rolled back, ensuring that the funds are neither lost nor duplicated.
It is important to note that Atomic Transactions are not automatically isolated transactions which ensures that concurrent execution of transactions leave the database in the same state that would have been obtained if the transactions were executed sequentially.