Okay, I read DBI doc and saw that the DBI_AUTOPROXY is
of the form 'hostname=?;port=?' and not the way I had it.
I thought I had read before that the syntax was in the
form below, but then I was wrong wasn't I :-)
Sorry for wasting time,
STH
On 11-Oct-01 Scott T. Hildreth wrote:
>
> Tim,
>
> A couple months back I posted to dbi-users asking if anyone
> had the following error when using the below method for
> connecting to the Database.
>
> $ENV{DBI_AUTOPROXY} = 'dbi:Proxy:hostname=srv1;port=3333';
> my $dbh = DBI->connect( "dbi:Oracle:sid", "user", "passwd",
> {RaiseError => 1} ) or die $DBI::errstr;
>
>
> Proxy.pm would complain that
> that hostname was not defined. I debugged the code and
> saw that the $dsn going into Proxy.pm as
>
> dbi:Proxy:hostname=srv1;port=3333;dsn=dbi:Oracle:sid
>
> ..to fix this I put the line $dsn =~ s/dbi:Proxy://i;
> in Proxy.pm and it worked. Yet I was the only one
> that was having this problem. So I finally got tired
> of changing Proxy.pm everytime I installed DBI and
> RTFM for DBD::Proxy. When I tried the connect method,
>
> DBI->connect("dbi:Proxy:hostname=srv1;port=3333;dsn=dbi:Oracle:sid"..etc
>
> Proxy.pm recieves the dsn of
>
> hostname=srv1;port=3333;dsn=dbi:Oracle:sid
>
> ..which it expects. I prefer setting the DBI_AUTOPROXY variable,
> leaving my original connect alone. So my question is should
> the patch involve fixing DBI.pm, the Proxy.pm fix I had done
> already or either fix is okay?
>
> Possible DBI fix,
>
> if ($ENV{DBI_AUTOPROXY} && $driver ne 'Proxy' && $driver ne 'Switch') {
> $dsn = "$ENV{DBI_AUTOPROXY};dsn=dbi:$driver:$dsn";
> $dsn =~ s/dbi:proxy://i;
> $driver = 'Proxy';
> DBI->trace_msg(" DBI_AUTOPROXY: dbi:$driver:$dsn\n");
> }
>
>
> STH
>
>
>
>
> ----------------------------------
> E-Mail: Scott T. Hildreth <[EMAIL PROTECTED]>
> Date: 11-Oct-01
> Time: 16:59:27
> ----------------------------------
----------------------------------
E-Mail: Scott T. Hildreth <[EMAIL PROTECTED]>
Date: 12-Oct-01
Time: 10:04:23
----------------------------------