From d9abca44cb1764bbd9e200dd3e086d0733b34d23 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Fri, 12 Aug 2016 13:14:19 +0200 Subject: [PATCH] CustomVariableConfig: single-dbh --- SL/Controller/CustomVariableConfig.pm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/SL/Controller/CustomVariableConfig.pm b/SL/Controller/CustomVariableConfig.pm index e0b587c33..1b780e5fc 100644 --- a/SL/Controller/CustomVariableConfig.pm +++ b/SL/Controller/CustomVariableConfig.pm @@ -197,13 +197,13 @@ sub create_or_update { return; } - my $dbh = $self->config->db; - $dbh->begin_work; + SL::DB->client->with_transaction(sub { + my $dbh = SL::DB->client->dbh; - $self->config->save; - $self->_set_cvar_validity() if $is_new; - - $dbh->commit; + $self->config->save; + $self->_set_cvar_validity() if $is_new; + 1; + }) or do { die SL::DB->client->error }; flash_later('info', $is_new ? t8('The custom variable has been created.') : t8('The custom variable has been saved.')); $self->redirect_to(action => 'list', module => $self->module); -- 2.20.1