]> wagnertech.de Git - mfinanz.git/blobdiff - SL/DB.pm
epic-ts
[mfinanz.git] / SL / DB.pm
index 29d0090ca2de1fe0e2bfde5d640ee92664a70fa7..60681c7e694d4a05e90731d54252ea679de15912 100644 (file)
--- a/SL/DB.pm
+++ b/SL/DB.pm
@@ -6,12 +6,12 @@ use Carp;
 use Data::Dumper;
 use English qw(-no_match_vars);
 use Rose::DB;
-use Rose::DBx::Cache::Anywhere;
+use SL::DB::Helper::Cache;
 use Scalar::Util qw(blessed);
 
 use base qw(Rose::DB);
 
-__PACKAGE__->db_cache_class('Rose::DBx::Cache::Anywhere');
+__PACKAGE__->db_cache_class('SL::DB::Helper::Cache');
 __PACKAGE__->use_private_registry;
 
 my (%_db_registered);
@@ -93,7 +93,7 @@ sub _register_db {
   my %flattened_settings = _flatten_settings(%connect_settings);
 
   $domain                = 'KIVITENDO' if $type =~ m/^KIVITENDO/;
-  $type                 .= join($SUBSCRIPT_SEPARATOR, map { ($_, $flattened_settings{$_} || '') } sort grep { $_ ne 'dbpasswd' } keys %flattened_settings);
+  $type                 .= join($SUBSCRIPT_SEPARATOR, map { ($_, $flattened_settings{$_} || '') } sort grep { $_ ne 'password' } keys %flattened_settings);
   my $idx                = "${domain}::${type}";
 
   if (!$_db_registered{$idx}) {
@@ -132,9 +132,9 @@ sub with_transaction {
   my $rv = 1;
 
   local $@;
-
+  my $return_array = wantarray;
   eval {
-    wantarray
+    $return_array
       ? $self->do_transaction(sub { @result = $code->(@args) })
       : $self->do_transaction(sub { $result = $code->(@args) });
   } or do {
@@ -150,7 +150,7 @@ sub with_transaction {
     }
   };
 
-  return wantarray ? @result : $result;
+  return $return_array ? @result : $result;
 }
 
 1;