import rt 3.0.12
[freeside.git] / rt / lib / RT / Handle.pm
index 5cdb65e..e60bbd9 100644 (file)
@@ -58,15 +58,17 @@ Takes nothing. Calls SUPER::Connect with the needed args
 =cut
 
 sub Connect {
-my $self=shift;
+    my $self = shift;
 
-# Unless the database port is a positive integer, we really don't want to pass it.
+    if ( $RT::DatabaseType eq 'Oracle' ) {
+        $ENV{'NLS_LANG'} = ".UTF8";
+    }
+
+    $self->SUPER::Connect( User     => $RT::DatabaseUser,
+                           Password => $RT::DatabasePassword, );
+
+    $self->dbh->{LongReadLen} = $RT::MaxAttachmentSize;
 
-$self->SUPER::Connect(
-                        User => $RT::DatabaseUser,
-                        Password => $RT::DatabasePassword,
-                       );
-   
 }
 
 =item BuildDSN
@@ -79,9 +81,11 @@ from the config file.
 
 sub BuildDSN {
     my $self = shift;
+# Unless the database port is a positive integer, we really don't want to pass it.
 $RT::DatabasePort = undef unless (defined $RT::DatabasePort && $RT::DatabasePort =~ /^(\d+)$/);
 $RT::DatabaseHost = undef unless (defined $RT::DatabaseHost && $RT::DatabaseHost ne '');
 
+
     $self->SUPER::BuildDSN(Host => $RT::DatabaseHost, 
                         Database => $RT::DatabaseName, 
                         Port => $RT::DatabasePort,