From: Rafael Kitover Date: Tue, 21 Jul 2009 16:16:34 +0000 (+0000) Subject: show Oracle datetime_setup alter session statements in debug output X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7a84c41bdf630e0bfe9b5d0d4158064c65c8747b;p=dbsrgits%2FDBIx-Class-Historic.git show Oracle datetime_setup alter session statements in debug output --- diff --git a/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm b/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm index ac1a3a1..9c50a3c 100644 --- a/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm +++ b/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm @@ -5,7 +5,7 @@ use warnings; =head1 NAME -DBIx::Class::Storage::DBI::Oracle::Generic - Automatic primary key class for Oracle +DBIx::Class::Storage::DBI::Oracle::Generic - Oracle Support for DBIx::Class =head1 SYNOPSIS @@ -52,7 +52,7 @@ sub _dbh_get_autoinc_seq { }; # trigger_body is a LONG - $dbh->{LongReadLen} = 64 * 1024 if ($dbh->{LongReadLen} < 64 * 1024); + local $dbh->{LongReadLen} = 64 * 1024 if ($dbh->{LongReadLen} < 64 * 1024); my $sth; @@ -195,7 +195,6 @@ for your timestamps, use something like this: sub connect_call_datetime_setup { my $self = shift; - my $dbh = $self->dbh; my $date_format = $ENV{NLS_DATE_FORMAT} ||= 'YYYY-MM-DD HH24:MI:SS'; my $timestamp_format = $ENV{NLS_TIMESTAMP_FORMAT} ||= @@ -203,9 +202,11 @@ sub connect_call_datetime_setup { my $timestamp_tz_format = $ENV{NLS_TIMESTAMP_TZ_FORMAT} ||= 'YYYY-MM-DD HH24:MI:SS.FF TZHTZM'; - $dbh->do("alter session set nls_date_format = '$date_format'"); - $dbh->do("alter session set nls_timestamp_format = '$timestamp_format'"); - $dbh->do("alter session set nls_timestamp_tz_format='$timestamp_tz_format'"); + $self->_do_query("alter session set nls_date_format = '$date_format'"); + $self->_do_query( +"alter session set nls_timestamp_format = '$timestamp_format'"); + $self->_do_query( +"alter session set nls_timestamp_tz_format='$timestamp_tz_format'"); } sub _svp_begin { @@ -266,11 +267,9 @@ sub _svp_rollback { $self->dbh->do("ROLLBACK TO SAVEPOINT $name") } -=head1 AUTHORS +=head1 AUTHOR -Andy Grundman - -Scott Connelly +See L. =head1 LICENSE