10.Using Transactions with InnoDB Tables

In this chapter, we will cover transactions in MySQL. When dealing with practical examples, we will primarily look at the InnoDB table type, but nearly everything said here applies equally well to BerkeleyDB tables.

Specifically, we will look at the following:

• What transactions are

• Using transactions in MySQL

• The InnoDB transaction model and ACID compliance

What Are Transactions?

The first thing to address in this chapter is what exactly is a transaction? In the context of a database management system, a transaction is a sequence of related instructions that must be treated as one indivisible unit. That is, all the work in the transaction must be done, or all of it must be left ...

Get MySQL Tutorial now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.