From c815c7236e442a9117808af8a3cc8445f5a35203 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Wed, 29 Jun 2016 16:44:57 +0200 Subject: [PATCH] IC: Umstellung IC::save auf single dbh --- SL/IC.pm | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/SL/IC.pm b/SL/IC.pm index 09b9bdbca..305d3f34c 100644 --- a/SL/IC.pm +++ b/SL/IC.pm @@ -224,12 +224,20 @@ sub retrieve_buchungsgruppen { } sub save { + my ($self, $myconfig, $form) = @_; $main::lxdebug->enter_sub(); + my $rc = SL::DB->client->with_transaction(\&_save, $self, $myconfig, $form); + + $main::lxdebug->leave_sub(); + return $rc; +} + +sub _save { my ($self, $myconfig, $form) = @_; my @values; # connect to database, turn off AutoCommit - my $dbh = $form->get_standard_dbh; + my $dbh = SL::DB->client->dbh; my $restricter = SL::HTML::Restrict->create; # save the part @@ -535,12 +543,7 @@ sub save { SQL do_query($form, $dbh, $query, ($form->{id}) x 2); - # commit - my $rc = $dbh->commit; - - $main::lxdebug->leave_sub(); - - return $rc; + return 1; } sub retrieve_assemblies { -- 2.20.1