I've spent a week spinning my wheels trying to make "simple" tasks work
using DBD, DBI, Proxy, ProxyServer, ODBC.

I have an Access97 database that will be used internally for a HelpDesk
and it is finished except for a few reports.  The second stage of the
project is to make the data accessible externally and preferably sharing
the "live" database.

I assumed that the best plan would be to have dbiproxy running on a
Windows platform so that I can still use the Access97 interface
internally (the current test box is Win98; a bad choice perhaps?) and
access the data via either a Sun Solaris Apache web server or telnet
clients using Perl CGI scripts or Perl standalone program.

The good news:  
  I am able to connect and query the database via the telnet option.

The bad news:
   The transparent compression available via the dbiproxy doesn't appear
to work.
   Neither side squawks until the connection statement executes.  The
dbiproxy says: 

> Mon Jul 16 22:37:25 2001 debug, Server starting in operation mode single
> Mon Jul 16 22:37:26 2001 notice, Server starting
> Mon Jul 16 22:37:26 2001 debug, Writing PID to /tmp/dbiproxy.pid
> Mon Jul 16 22:37:59 2001 debug, Connection from 99.99.99.99, port 42599
> Mon Jul 16 22:37:59 2001 debug, Child clone: DBI::ProxyServer=HASH(0x1d20410)
> Mon Jul 16 22:37:59 2001 debug, New child starting 
>(DBI::ProxyServer=HASH(0x1d20410)).
> Mon Jul 16 22:38:00 2001 debug, Accepting client from 99.99.99.99, port 42599
> Mon Jul 16 22:38:00 2001 err, Child died: Unexpected EOF from client at 
>     C:/Perl/site/lib/RPC/PlServer.pm line 149.
> Mon Jul 16 22:38:00 2001 debug, Child terminating.

The trace(9) level diagnostic says:

>     DBI 1.18-nothread dispatch trace level set to 9
>     -> DBI->connect(dbi:Proxy:hostname=99.99.99.99;port=3333;compression=gzip;
>           dsn=DBI:ODBC:HelpDesk, , ****)
>     -> DBI->install_driver(Proxy) for perl=5.006 pid=21198 ruid=0 euid=0
>           install_driver: DBD::Proxy version 0.2003 loaded from 
>           /usr/local/lib/perl5/site_perl/5.6.0/sun4-solaris/DBD/Proxy.pm
>     New DBI::dr (for DBD::Proxy::dr, parent=, id=)
>           dbih_setup_handle(DBI::dr=HASH(0x16aa50)=>DBI::dr=HASH(0x22dd28), 
>           DBD::Proxy::dr, 0, Null!)
>     dbih_make_com(Null!, DBD::Proxy::dr, 172)
>     dbih_setup_attrib(DBI::dr=HASH(0x22dd28), Err, Null!) SCALAR(0x249e9c) 
>           (already defined)
>     dbih_setup_attrib(DBI::dr=HASH(0x22dd28), State, Null!) SCALAR(0x16ac5c) 
>           (already defined)
>     dbih_setup_attrib(DBI::dr=HASH(0x22dd28), Errstr, Null!) SCALAR(0x249eb4) 
>           (already defined)
>     dbih_setup_attrib(DBI::dr=HASH(0x22dd28), Handlers, Null!) ARRAY(0x2db214) 
>           (already defined)
>     dbih_setup_attrib(DBI::dr=HASH(0x22dd28), Debug, Null!) 0 (already defined)
>     <- install_driver= DBI::dr=HASH(0x16aa50)
>     >> connect     DISPATCH (DBI::dr=HASH(0x16aa50) rc1/3 @5 g0 a195248) at 
>           /usr/local/lib/perl5/site_perl/5.6.0/sun4-solaris/DBI.pm line 416.
>     -> connect for DBD::Proxy::dr (DBI::dr=HASH(0x16aa50)~0x22dd28 
>           'hostname=99.99.99.99;port=3333;compression=gzip;dsn=DBI:ODBC:HelpDesk' 
>           '' **** HASH(0xe9960))
>     !! ERROR: 1 'Cannot log in to DBI::ProxyServer: Unexpected EOF from server at
>           /usr/local/lib/perl5/site_perl/5.6.0/RPC/PlClient.pm line 83.'
>     <- connect= undef at /usr/local/lib/perl5/site_perl/5.6.0/sun4-solaris/DBI.pm
>           line 416.
>     >> errstr      DISPATCH (DBI::dr=HASH(0x16aa50) rc1/3 @1 g0 a1951b8) at 
>           /usr/local/lib/perl5/site_perl/5.6.0/sun4-solaris/DBI.pm line 417.
>     -> errstr in DBD::_::common for DBD::Proxy::dr (DBI::dr=HASH(0x16aa50)~0x22dd28)
>     <- errstr= 'Cannot log in to DBI::ProxyServer: Unexpected EOF from server at
>           /usr/local/lib/perl5/site_perl/5.6.0/RPC/PlClient.pm line 83.
>           at /usr/local/lib/perl5/site_perl/5.6.0/sun4-solaris/DBI.pm line 417.
>        DBI->connect(hostname=99.99.99.99;port=3333;compression=gzip;
>           dsn=DBI:ODBC:HelpDesk) failed: Cannot log in to 
>           DBI::ProxyServer: Unexpected EOF from server at
>           /usr/local/lib/perl5/site_perl/5.6.0/RPC/PlClient.pm line 83.

The Solaris Sun box program says:

> DBI->connect(hostname=99.99.99.99;port=3333;compression=gzip;dsn=DBI:ODBC:HelpDesk)
>    failed: Cannot log in to DBI::ProxyServer: Unexpected EOF from server at 
>    /usr/local/lib/perl5/site_perl/5.6.0/RPC/PlClient.pm line 83.  at odbc.p line 21

If I read this correctly, my compression=gzip was eaten by either the
Solaris Proxy or DBI module.

The dbiproxy batch file:

> @echo off
> call dbiproxy --configfile hdproxy.cfg --compression gzip --debug

The dbiproxy config file:

> {  facility  => 'daemon',
>    pidfile   => '/junk/dbiproxy.pid',
> #   user      => 'nobody',
> #   group     => 'nobody',
>    localport => '3333',
> #   mode      => 'fork',
>    logfile   => 'STDERR',
>    autocommit => '0',
>    RaiseError => '1',
>    LongReadLen => '100000',
> 
> # Access control
> 
>    clients => [
>       # Accept the following addresses as clients
>       { mask => '^999\.999\.999\.999', accept => 1 }, ## Sun Solaris box
>       { mask => '^999\.999\.999\.9',   accept => 1 }, ## my office computer
>       { mask => '^99\.99\.99\.99',     accept => 1 }, ## my home computer
>       # Deny anyone else
>       { mask => '.*',                 accept => 0 }
>    ]
> }

The Sun Solaris perl program:

> #!/usr/local/bin/perl -w
> use strict;
> use DBI;
> use Compress::Zlib;
> use Socket;
> use Sys::Hostname;
> 
> my $who = `who -m`;
> my $symname = (split(" ",$who))[-1];
> $symname =~ tr/\(\)//d; ## remove parens
> my $addr = inet_ntoa(scalar gethostbyname($symname || 'localhost'));
> 
> my ($fctr, $data, $dbh);
> my $dsn = "DBI:ODBC:HelpDesk";
> my $proxy = "hostname=$addr;port=3333";
> my $compression = "compression=gzip";
> 
> unlink 'dbitrace.log' if (-e 'dbitrace.log');
> DBI->trace(9, 'dbitrace.log');  ## turn level 9 trace on
> $dbh = DBI->connect("dbi:Proxy:$proxy;$compression;dsn=$dsn",'','');
> DBI->trace(0);  ## turn trace off

Almost everything here was based on examples and suggestions I found in
"Programming the Perl DBI".  Does anyone have any clues on this?  (TimB
perhaps?) Thanks for any help you can give.

I have made several posts at www.perlmonks.org as jlongino (search
compression=gzip) and there were a few suggestions but none of them
solved the problem.  I even sent a message to Jochen Wiedmann (author of
DBD::Proxy and DBI::ProxyServer) but haven't received a reply.

Reply via email to