Thanks to respondents to my first posting: ODBC Connect with compression=gzip

I've spent a week trying to make the Proxy/ProxyServer transparent compression work.

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

I thought 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 dbiproxy is attractive because of its transparent compression (if I can ever get it to work) and encryption (I pray that implementing it will be easier). It also allows for client and client/transaction access control via the dbiproxy config file. Is there a better/less buggy way to achieve the second stage?

If I forget about the compression most everything else works except changing the dbiproxy to mode=>threads or mode=>fork but that may be a result of either/or both ActivePerl/Solaris Perl not having been compiled for threads. Seems to me that at least the mode=>fork should work though. Using the dbiproxy as mode=>single means that:

"If the server has accepted a connection, he will enter the Run() method. No other connections are accepted until the Run() method returns (if the client disconnects)."
So, I guess that if I connect, execute a run statement, and disconnect each time I run a query, dbiproxy will be able handle a small number of users (probably not more than two or three at any given time) easily?

The dbiproxy debug messages:

Mon Jul 16 22:37:25 2001 debug, Server starting in operation mode sing +le 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 4259 +9 Mon Jul 16 22:37:59 2001 debug, Child clone: DBI::ProxyServer=HASH(0x1 +d20410) Mon Jul 16 22:37:59 2001 debug, New child starting (DBI::ProxyServer=H +ASH(0x1d20410)). Mon Jul 16 22:38:00 2001 debug, Accepting client from 99.99.99.99, por +t 42599 Mon Jul 16 22:38:00 2001 err, Child died: Unexpected EOF from client a +t C:/Perl/site/lib/RPC/PlServer.pm line 149. Mon Jul 16 22:38:00 2001 debug, Child terminating.
The DBI->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;compressi +on=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(0x22d +d28), DBD::Proxy::dr, 0, Null!) dbih_make_com(Null!, DBD::Proxy::dr, 172) dbih_setup_attrib(DBI::dr=HASH(0x22dd28), Err, Null!) SCALAR(0x249 +e9c) (already defined) dbih_setup_attrib(DBI::dr=HASH(0x22dd28), State, Null!) SCALAR(0x1 +6ac5c) (already defined) dbih_setup_attrib(DBI::dr=HASH(0x22dd28), Errstr, Null!) SCALAR(0x +249eb4) (already defined) dbih_setup_attrib(DBI::dr=HASH(0x22dd28), Handlers, Null!) ARRAY(0 +x2db214) (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 a19524 +8) at /usr/local/lib/perl5/site_perl/5.6.0/sun4-solaris/DBI.pm lin +e 416. -> connect for DBD::Proxy::dr (DBI::dr=HASH(0x16aa50)~0x22dd28 'hostname=99.99.99.99;port=3333;compression=gzip;dsn=DBI:ODB +C:HelpDesk' '' **** HASH(0xe9960)) !! ERROR: 1 'Cannot log in to DBI::ProxyServer: Unexpected EOF fro +m 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-sol +aris/DBI.pm line 416. >> errstr DISPATCH (DBI::dr=HASH(0x16aa50) rc1/3 @1 g0 a1951b +8) at /usr/local/lib/perl5/site_perl/5.6.0/sun4-solaris/DBI.pm lin +e 417. -> errstr in DBD::_::common for DBD::Proxy::dr (DBI::dr=HASH(0x16a +a50)~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:O +DBC:HelpDesk) failed: Cannot log in to DBI::ProxyServer: Unexpected EOF from serv +er at /usr/local/lib/perl5/site_perl/5.6.0/RPC/PlClient.pm line 83. at o +dbc.p line 21
The dbiproxy batch file:
@echo off call dbiproxy --configfile hdproxy.cfg --compression gzip --debug
The dbiproxy config file:
{ facility => 'daemon', pidfile => '/junk/dbiproxy.pid', localport => '3333', 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 co +mputer { mask => '^99\.99\.99\.99', accept => 1 }, ## my home comp +uter # 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?

Thanks for any help you can give. If I can't resolve this soon we'll have to buy and setup a NT server and run MS SQL (Ick!)


In reply to More info on Proxy/ProxyServer compression=gzip by jlongino

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.