X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/abc355d2775cda30c745a277faf1307acb5a249b..bbb2383f64acde4451b241c200600e4bb33a9030:/SL/DB.pm diff --git a/SL/DB.pm b/SL/DB.pm index 29d0090ca..c678ed14f 100644 --- 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); @@ -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;