Revision 6844d581
Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt
SL/DBUpgrade2.pm | ||
---|---|---|
243 | 243 |
$dbh->begin_work; |
244 | 244 |
|
245 | 245 |
# setup dbup_ export vars & run script |
246 |
my $old_dbh = $::form->set_standard_dbh($dbh); |
|
246 | 247 |
my %dbup_myconfig = map { ($_ => $::form->{$_}) } qw(dbname dbuser dbpasswd dbhost dbport dbconnect); |
247 | 248 |
my $result = eval { |
248 | 249 |
SL::DBUpgrade2::Base::execute_script( |
... | ... | |
255 | 256 |
|
256 | 257 |
my $error = $EVAL_ERROR; |
257 | 258 |
|
259 |
$::form->set_standard_dbh($old_dbh); |
|
260 |
|
|
258 | 261 |
$dbh->rollback if 1 != ($result // -1); |
259 | 262 |
|
260 | 263 |
return $error if $self->{return_on_error} && (1 != ($result // -1)); |
SL/Form.pm | ||
---|---|---|
1403 | 1403 |
return $standard_dbh; |
1404 | 1404 |
} |
1405 | 1405 |
|
1406 |
sub set_standard_dbh { |
|
1407 |
my ($self, $dbh) = @_; |
|
1408 |
my $old_dbh = $standard_dbh; |
|
1409 |
$standard_dbh = $dbh; |
|
1410 |
|
|
1411 |
return $old_dbh; |
|
1412 |
} |
|
1413 |
|
|
1406 | 1414 |
sub date_closed { |
1407 | 1415 |
$main::lxdebug->enter_sub(); |
1408 | 1416 |
|
Auch abrufbar als: Unified diff
DBUpgrade2: verhindern, dass $::form->get_standard_dbh eine zweite Verbindung öffnet
Ansonsten sind Deadlocks absolut möglich.