Bugzilla – Bug 8261
AutoCommit=0 causes DBIx's own transactions to fail
Last modified: 2009-07-30 14:02:51 UTC
Setting Autocommit=0 on the DB handle in Slim/Music/Import.pm and Slim/Schema/Playlist.pm causes recent DBI + DBD::Mysql + DBIx to crash; autocommit=0 is implemented by starting an implicit transaction, so when DBIx::Class::Schema::txn_do tries to start a second one, DBD::Mysql falls over with an error like: [08-05-28 23:04:02.7414] Slim::Music::Import::setIsScanning (266) Error: Failed to update isScanning: [Carp::Clan::__ANON__(): Carp::Clan::__ANON__(): DBI Exception: DBD::mysql::db begin_work failed: Already in a transaction at /usr/lo cal/squeezecenter/Slim/Schema/Storage.pm line 74 ...and no writes to the database ever happen. From a fresh install, that means that you can never add any music to the library, leaving squeezecenter somewhat useless. The supposed performance gains you get from turning autocommit off don't exist anyway. As DBIx is using transactions and committing (or rolling back) each one, the writes and synchronisation are happening no matter what autocommit is set to - thats if it didn't crash... The fix - remove the Slim::Schema->storage->dbh->{'AutoCommit'} = 0; from Import.pm and Playlist.pm
Confirmed here; scanner.pl needs the same change (but then there are bogus warnings about unnecessary commits).