From 0fc625729439799ea3df4765da9ec0562315a180 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 3 Feb 2011 10:19:47 +0100 Subject: [PATCH] =?utf8?q?$form->get=5Fstandard=5Fdbh=20nicht=20von=20Rose?= =?utf8?q?=20ge=C3=B6ffnetes=20Datenbankhandle=20nutzen=20lassen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Rose setzt Datenbankhandle auf autocommit. Die Semantik von get_standard_dbh ist aber, dass autocommit aus ist und die Funktionen selber ein Commit machen. --- SL/Form.pm | 2 +- SL/OE.pm | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/SL/Form.pm b/SL/Form.pm index 0637e6ebb..bd16b4c30 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -1616,7 +1616,7 @@ sub get_standard_dbh { undef $standard_dbh; } - $standard_dbh ||= SL::DB::create->dbh; + $standard_dbh ||= $self->dbconnect_noauto($myconfig); $main::lxdebug->leave_sub(2); diff --git a/SL/OE.pm b/SL/OE.pm index 8adaf6af2..28e3975c3 100644 --- a/SL/OE.pm +++ b/SL/OE.pm @@ -559,11 +559,6 @@ sub save { } } - $self->save_periodic_invoices_config(dbh => $dbh, - oe_id => $form->{id}, - config_yaml => $form->{periodic_invoices_config}) - if ($form->{type} eq 'sales_order'); - $form->{saved_xyznumber} = $form->{$form->{type} =~ /_quotation$/ ? "quonumber" : "ordnumber"}; @@ -571,6 +566,11 @@ sub save { my $rc = $dbh->commit; + $self->save_periodic_invoices_config(dbh => $dbh, + oe_id => $form->{id}, + config_yaml => $form->{periodic_invoices_config}) + if ($form->{type} eq 'sales_order'); + $main::lxdebug->leave_sub(); return $rc; -- 2.20.1