We often recommend to our clients to convert their current
database from MyISAM tables to InnoDB.
The transfer by itself in most cases is almost plain, however the
application can be broken by new unexpected errors
1205 (ER_LOCK_WAIT_TIMEOUT)
Lock wait timeout expired. Transaction was rolled back.
1213 (ER_LOCK_DEADLOCK)
Transaction deadlock. You should rerun the transaction.
It is not hard to handle these errors, but you should be aware
of.
This is some thing we do in our PHP applications:
PLAIN TEXT CODE:
- class mysqlx extends mysqli {
- ...
- function deadlock_query($query) {
- $MAX_ATTEMPS = 100;
- $current = 0;
- while ($current++ <$MAX_ATTEMPS) …