Revision 6b23fb21
Von Sven Schöling vor mehr als 8 Jahren hinzugefügt
SL/AM.pm | ||
---|---|---|
498 | 498 |
SL::DB->client->with_transaction(sub { |
499 | 499 |
$query = qq|DELETE FROM leads WHERE id = ?|; |
500 | 500 |
do_query($form, SL::DB->client->dbh, $query, $form->{id}); |
501 |
}); |
|
501 |
1; |
|
502 |
}) or do { die SL::DB->client->error }; |
|
502 | 503 |
|
503 | 504 |
$main::lxdebug->leave_sub(); |
504 | 505 |
} |
... | ... | |
606 | 607 |
") VALUES (?, ?, ?, ?, ?, ?)"; |
607 | 608 |
} |
608 | 609 |
do_query($form, $dbh, $query, @values); |
609 |
}); |
|
610 |
1; |
|
611 |
}) or do { die SL::DB->client->error }; |
|
610 | 612 |
|
611 | 613 |
$main::lxdebug->leave_sub(); |
612 | 614 |
} |
... | ... | |
627 | 629 |
|
628 | 630 |
$query = "DELETE FROM language WHERE id = ?"; |
629 | 631 |
do_query($form, $dbh, $query, $form->{"id"}); |
630 |
}); |
|
632 |
1; |
|
633 |
}) or do { die SL::DB->client->error }; |
|
631 | 634 |
|
632 | 635 |
$main::lxdebug->leave_sub(); |
633 | 636 |
} |
... | ... | |
796 | 799 |
|
797 | 800 |
# set close in defaults |
798 | 801 |
do_query($form, $dbh, $query, @values); |
799 |
}); |
|
802 |
1; |
|
803 |
}) or do { die SL::DB->client->error }; |
|
800 | 804 |
|
801 | 805 |
$main::lxdebug->leave_sub(); |
802 | 806 |
} |
... | ... | |
1097 | 1101 |
} |
1098 | 1102 |
$sth->finish(); |
1099 | 1103 |
} |
1100 |
}); |
|
1104 |
1; |
|
1105 |
}) or do { die SL::DB->client->error }; |
|
1101 | 1106 |
|
1102 | 1107 |
$main::lxdebug->leave_sub(); |
1103 | 1108 |
} |
... | ... | |
1375 | 1380 |
SL::DB->client->with_transaction(sub { |
1376 | 1381 |
$query = qq|DELETE FROM tax WHERE id = ?|; |
1377 | 1382 |
do_query($form, SL::DB->client->dbh, $query, $form->{id}); |
1378 |
}); |
|
1383 |
1; |
|
1384 |
}) or do { die SL::DB->client->error }; |
|
1379 | 1385 |
|
1380 | 1386 |
$main::lxdebug->leave_sub(); |
1381 | 1387 |
} |
... | ... | |
1400 | 1406 |
} |
1401 | 1407 |
|
1402 | 1408 |
do_query($form, $dbh, $query, @values); |
1403 |
}); |
|
1409 |
1; |
|
1410 |
}) or do { die SL::DB->client->error }; |
|
1404 | 1411 |
|
1405 | 1412 |
$main::lxdebug->leave_sub(); |
1406 | 1413 |
} |
... | ... | |
1443 | 1450 |
|
1444 | 1451 |
SL::DB->client->with_transaction(sub { |
1445 | 1452 |
do_query($form, SL::DB->client->dbh, qq|DELETE FROM price_factors WHERE id = ?|, conv_i($form->{id})); |
1446 |
}); |
|
1453 |
1; |
|
1454 |
}) or do { die SL::DB->client->error }; |
|
1447 | 1455 |
|
1448 | 1456 |
$main::lxdebug->leave_sub(); |
1449 | 1457 |
} |
... | ... | |
1480 | 1488 |
|
1481 | 1489 |
$sth->finish(); |
1482 | 1490 |
} |
1483 |
}); |
|
1491 |
1; |
|
1492 |
}) or do { die SL::DB->client->error }; |
|
1484 | 1493 |
|
1485 | 1494 |
$main::lxdebug->leave_sub(); |
1486 | 1495 |
} |
... | ... | |
1512 | 1521 |
} |
1513 | 1522 |
|
1514 | 1523 |
$sth->finish(); |
1515 |
}); |
|
1524 |
1; |
|
1525 |
}) or do { die SL::DB->client->error }; |
|
1516 | 1526 |
|
1517 | 1527 |
$main::lxdebug->leave_sub(); |
1518 | 1528 |
} |
Auch abrufbar als: Unified diff
single-dbh: Fehler in Transaktionen immer weiterwerfen