X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=inline;f=SL%2FDB.pm;h=26c01ccbadbe6631325860f5ff6ab459b1d9964a;hb=d64013f4ba48d1f34e1d55f8c5f98d0ab2b5ed2b;hp=54214c8cafa7318afa32da0d77c226e7939979f9;hpb=576c2a14f72af8f2cfe5679b6c264f13aff39ddf;p=kivitendo-erp.git diff --git a/SL/DB.pm b/SL/DB.pm index 54214c8ca..26c01ccba 100644 --- a/SL/DB.pm +++ b/SL/DB.pm @@ -4,7 +4,6 @@ use strict; use Carp; use Data::Dumper; -use SL::DBConnect; use English qw(-no_match_vars); use Rose::DB; use Rose::DBx::Cache::Anywhere; @@ -19,6 +18,8 @@ my (%_db_registered); sub dbi_connect { shift; + # runtime require to break circular include + require SL::DBConnect; return SL::DBConnect->connect(@_); } @@ -37,12 +38,13 @@ sub _register_db { my $domain = shift; my $type = shift; + require SL::DBConnect; my %specific_connect_settings; my %common_connect_settings = ( driver => 'Pg', european_dates => ((SL::DBConnect->get_datestyle || '') =~ m/european/i) ? 1 : 0, connect_options => { - pg_enable_utf8 => $::locale && $::locale->is_utf8, + pg_enable_utf8 => 1, }, ); @@ -164,7 +166,7 @@ starting one if none is currently active. Example: }); One big difference to L is the return code -handling. If a transaction is already active then C +handling. If a transaction is already active then C simply returns the result of calling C<$code_ref> as-is. Otherwise the return value depends on the result of the underlying