aboutsummaryrefslogtreecommitdiff
path: root/audio/squeezeboxserver/files/patch-dbix-class-bug.diff
blob: 4745e571a74b314def62620c640a1f106529c94c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Index: Slim/Schema.pm
===================================================================
--- Slim/Schema.pm.orig	2011-01-24 15:15:39 UTC
+++ Slim/Schema.pm
@@ -274,11 +274,15 @@ sub _connect {
 	# For custom exceptions
 	$class->storage_type('Slim::Schema::Storage');
 	
+	# Don't use autocommit mode for the scanner.
+	# Needs to be set here as setting dbh->{'AutoCommit'} = 0 later
+	# confusing the transaction nesting logic.
+	my $AutoCommit = (main::SCANNER ? 0 : 1);
 	my $on_connect_do = $sqlHelperClass->on_connect_do();
 	
 	$class->connection( $dsn || $source, $username, $password, { 
 		RaiseError    => 1,
-		AutoCommit    => 1,
+		AutoCommit    => $AutoCommit, 
 		PrintError    => 0,
 		Taint         => 1,
 		on_connect_do => [
--- scanner.pl.orig	2011-03-21 13:05:58 UTC
+++ scanner.pl
@@ -236,9 +236,6 @@ sub main {
 
 	main::INFOLOG && $log->info("Squeezebox Server Scanner done init...\n");
 
-	# Take the db out of autocommit mode - this makes for a much faster scan.
-	Slim::Schema->storage->dbh->{'AutoCommit'} = 0;
-
 	my $scanType = 'SETUP_STANDARDRESCAN';
 
 	if ($wipe) {