I was reading default.settings.php for Drupal 7.x this afternoon, and came across this comment:
/* * Some database engines support transactions. In order to enable * transaction support for a given database, set the 'transactions' key * to TRUE. To disable it, set it to FALSE. Note that the default value * varies by driver. For MySQL, the default is FALSE since MyISAM tables * do not support transactions. */
This is different in Drupal 8:
/* * Transaction support is enabled by default for all drivers that support it, * including MySQL. To explicitly disable it, set the 'transactions' key to * FALSE. * Note that some configurations of MySQL, such as the MyISAM engine, don't * support it and will proceed silently even if enabled. If you experience * transaction related crashes with such configuration, set the 'transactions' * key to FALSE. */
So, how does
db_transaction() work then on MySQL in Drupal 7?
Is this comment outdated, or should I explicitly set
$databases['default']['default']['transactions'] = TRUE;
if I know everything is InnoDB (which is the default for Drupal 7.