When working with database it is often essential to use transactions. Say for example that I want to transfer a certain amount of money from account A to account B. This involves two queries:
In theory I can make the queries separately, but errors happen. So, to be sure, I can pack the two queries inside a transaction and be sure that either both operations end regularly or nothing has changed at all. No money disappears or is created.
The problem is that it seems to me that this only shifts the responsibility from me to the database vendor. Now it is up to the database to make both operations and be sure that either both are made or nothing has changed. And the database developers face the same problems that errors happen.
What techniques do database vendors use to ensure safety for transactions?
Steps in a TransactionLocate the record to be updated from secondary storage. Transfer the block disk into the memory buffer. Make the update to tuple in the buffer buffer. Write the modified block back out to disk.
The transaction remains in effect until a COMMIT or ROLLBACK statement has been explicitly issued. This means that when, say, an UPDATE statement is issued on a specific record in a database, SQL Server will maintain a lock on the data scoped for data modification until either a COMMIT or ROLLBACK is issued.
About the Vendor Database. The Vendor database stores information about your vendors. Because the system is fully integrated, the information you enter in the Vendor database is automatically supplied to other parts of the system.
Transaction management [1, 2] refers to the tasks of processing multiple transactions issued by various clients of a database server in such a way that the ACID contract can be fulfilled, that is, the properties of atomicity, consistency preservation, isolation, and durability of each individual transaction can be ...
The ACID - Implementations page on wikipedia will get you started on write-ahead logging, shadow paging and multi-version concurrency control. Follow the links to find more.
Each DBMS vendor implements their own algorithms, often several different ones depending on the context, full ACID or relaxed requirements, distributed transaction consistency requirements etc...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With