Q&A

Q1:Why do I need to be concerned about table locks and transaction-safe tables?
A1: Locks and transaction-safe tables are important in a multithreaded environment, in which client threads have the job of updating, inserting into, or deleting from the database. If it's important for a thread to perform a sequence of queries and always have a consistent view of the data, consider using locks or transaction-safe tables.
Q2:Is it better to use table locks or transaction-safe tables?
A2: If you have a low-traffic system in which there's little contention for getting locks (in other words, clients seldom have to wait), locks may be easier to implement. You can also use the default table type, MyISAM.

In systems with high traffic, in which waiting ...

Get Sams Teach Yourself MySQL in 21 Days, Second Edition 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.