X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/c51601f019f963dcdc875469514aa40802b5c574..d32410ac096b:/SL/DBConnect/Cache.pm diff --git a/SL/DBConnect/Cache.pm b/SL/DBConnect/Cache.pm index 778785ce0..c133e8a3d 100644 --- a/SL/DBConnect/Cache.pm +++ b/SL/DBConnect/Cache.pm @@ -35,10 +35,19 @@ sub reset { $dbh; } +sub reset_all { + $_->{AutoCommit} || $_->rollback for values %cache; +} + sub clear { %cache = (); } +sub disconnect_all_and_clear { + $_->disconnect for values %cache; + %cache = (); +} + sub _args2str { my (@args) = @_; @@ -52,7 +61,7 @@ sub _args2str { map { $_ => $options->{$_} } sort keys %$options; # deterministic order - join ';', apply { s/([;\\])/\\$1/g } $dbconnect, $dbuser, $dbpasswd, $options_str, $initial_sql; + join ';', apply { $_ //= ''; s/([;\\])/\\$1/g } $dbconnect, $dbuser, $dbpasswd, $options_str, $initial_sql; } 1;