projects
/
kivitendo-erp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
0022ca3
)
GenericTranslations: single-dbh
author
Sven Schöling
<s.schoeling@linet-services.de>
Mon, 1 Aug 2016 14:02:39 +0000
(16:02 +0200)
committer
Sven Schöling
<s.schoeling@linet-services.de>
Fri, 2 Sep 2016 12:21:29 +0000
(14:21 +0200)
SL/GenericTranslations.pm
patch
|
blob
|
history
diff --git
a/SL/GenericTranslations.pm
b/SL/GenericTranslations.pm
index
a509212
..
4f33ab4
100644
(file)
--- a/
SL/GenericTranslations.pm
+++ b/
SL/GenericTranslations.pm
@@
-1,6
+1,7
@@
package GenericTranslations;
use SL::DBUtils;
package GenericTranslations;
use SL::DBUtils;
+use SL::DB;
use strict;
use strict;
@@
-90,8
+91,16
@@
sub list {
}
sub save {
}
sub save {
+ my ($self, %params) = @_;
$main::lxdebug->enter_sub();
$main::lxdebug->enter_sub();
+ my $rc = SL::DB->client->with_transaction(\&_save, %params);
+
+ $::lxdebug->leave_sub;
+ return $rc;
+}
+
+sub _save {
my $self = shift;
my %params = @_;
my $self = shift;
my %params = @_;
@@
-100,7
+109,7
@@
sub save {
my $myconfig = \%main::myconfig;
my $form = $main::form;
my $myconfig = \%main::myconfig;
my $form = $main::form;
- my $dbh = $params{dbh} ||
$form->get_standard_dbh($myconfig)
;
+ my $dbh = $params{dbh} ||
SL::DB->client->dbh
;
$params{translation} =~ s/^\s+//;
$params{translation} =~ s/\s+$//;
$params{translation} =~ s/^\s+//;
$params{translation} =~ s/\s+$//;
@@
-139,9
+148,7
@@
sub save {
do_query($form, $dbh, $q_insert, @v_insert);
}
do_query($form, $dbh, $q_insert, @v_insert);
}
- $dbh->commit() unless ($params{dbh});
-
- $main::lxdebug->leave_sub();
+ return 1;
}
}