Hi,
I have the following (test-) programme:
-- code starts --
use DBI;
my $dsn = "dbi:ODBC:bdb";
my $proxy = "hostname=192.168.0.1;port=3333";
print STDERR ( "connecting to proxy server\n" );
my $db_handle = DBI->connect("dbi:Proxy:$proxy;dsn=$dsn", "", "");
print STDERR "got $db_handle\n";
my $st_handle = $db_handle->prepare("select count(*) from Basis");
$st_handle->execute();
print $st_handle->fetchrow_array();
print "\n";
$db_handle->disconnect();
print STDERR ( "connecting to proxy server\n" );
$db_handle = DBI->connect("dbi:Proxy:$proxy;dsn=$dsn", "", "");
print STDERR "got $db_handle\n";
$st_handle = $db_handle->prepare("select count(*) from Basis");
$st_handle->execute();
print $st_handle->fetchrow_array();
print "\n";
$db_handle->disconnect();
-- code ends --
The first connect - as well as the statement - are executed as expected
and I get the correct result. The second connect - however - fails or
rather doesn't come back. The print statement "connecting to proxy
server" works but the programme doesn't return from the connect.
The interesting thing is that when I start a second instance of the
programme that instance also hangs while the first instance is still
alive. If I kill the first process, the second will execute the first
connect and fetch the result and the hang in the second connect.
The proxy's debug log is as follows:
-- proxy's debug log starts --
Fri Jan 17 10:32:35 2003 debug, New child starting
DBI::ProxyServer=HASH(0x262f91c)).
Fri Jan 17 10:32:35 2003 debug, Accepting client from 192.168.0.1, port 1337
Fri Jan 17 10:32:35 2003 debug, Client logs in: Application
dbi:ODBC:bdb, version 0.2003, user
Fri Jan 17 10:32:35 2003 debug, Connecting to dbi:ODBC:bdb as
Fri Jan 17 10:32:36 2003 debug, Accepting client
Fri Jan 17 10:32:36 2003 debug, Client executes method CallMethod
Fri Jan 17 10:32:36 2003 debug, CallMethod: =>
DBI::ProxyServer::db=HASH(0x2636e0c),STORE,AutoCommit,1
Fri Jan 17 10:32:36 2003 debug, CallMethod: <= 1
Fri Jan 17 10:32:36 2003 debug, Client executes method CallMethod
Fri Jan 17 10:32:36 2003 debug, CallMethod: =>
DBI::ProxyServer::db=HASH(0x2636e0c),prepare,select count(*) from
Basis,,ARRAY(0x2636da0)
Fri Jan 17 10:32:36 2003 debug, CallMethod: <=
DBI::ProxyServer::st=HASH(0x262f874),1,0,ARRAY(0x262f79c),ARRAY(0x262f94c),-1
Fri Jan 17 10:32:36 2003 debug, Client executes method CallMethod
Fri Jan 17 10:32:36 2003 debug, CallMethod: =>
DBI::ProxyServer::st=HASH(0x262f874),fetch,20
Fri Jan 17 10:32:36 2003 debug, CallMethod: <= ARRAY(0x262f844)
Fri Jan 17 10:32:36 2003 debug, Client executes method DestroyHandle
=> programme stops here <=
=> after hitting Ctrl-C
Fri Jan 17 10:32:42 2003 err, Child died: Error while reading socket:
Invalid argument at C:/Perl/site/lib/RPC/PlServer/Comm.pm line 109.
Fri Jan 17 10:32:42 2003 debug, Child terminating.
Fri Jan 17 10:32:43 2003 debug, Connection from 192.168.0.1, port 1338
Fri Jan 17 10:32:43 2003 debug, Child clone:
DBI::ProxyServer=HASH(0x2636e30)
Fri Jan 17 10:32:43 2003 debug, New child starting
(DBI::ProxyServer=HASH(0x2636e30)).
Fri Jan 17 10:32:43 2003 debug, Accepting client from 192.168.0.1, port 1338
Fri Jan 17 10:32:43 2003 err, Child died: Error while reading socket:
Invalid argument at C:/Perl/site/lib/RPC/PlServer/Comm.pm line 109.
Fri Jan 17 10:32:43 2003 debug, Child terminating.
-- proxy's debug log starts --
Another pair of log file messages comes from an apache log and the
dbiproxy debug log, the code used to connect to the proxy is the same as
above:
-- Apache log file --
DBI->connect(hostname=192.168.0.1;port=3333;dsn=dbi:ODBC:bdb) failed:
Cannot log in to DBI::ProxyServer: Error while writing socket: Invalid
argument at c:/Perl/site/lib/RPC/PlServer/Comm.pm line 76.
-- Corresponding dbiproxy debug log entry --
Fri Jan 17 10:57:15 2003 debug, Connection from 192.168.0.1, port 1452
Fri Jan 17 10:57:15 2003 debug, Child clone:
DBI::ProxyServer=HASH(0x26566e0)
Fri Jan 17 10:57:15 2003 debug, New child starting
(DBI::ProxyServer=HASH(0x26566e0)).
Fri Jan 17 10:57:16 2003 debug, Accepting client from 192.168.0.1, port 1452
Fri Jan 17 10:57:16 2003 err, Child died: Unexpected EOF from client at
C:/Perl/site/lib/RPC/PlServer.pm line 149.
Fri Jan 17 10:57:16 2003 debug, Child terminating.
-- logs end --
I have no idea where that behaviour comes from and am clearly at my
wits' end. I can't even say whether the error comes from the database
(MS SQL Server 2000), the ODBC interface (I don't see anything in the
log file), the operating system (Windows 2000), DBI::Proxy, Perl, or the
RPC-Modules.
I apologise if the above should not be relevant here and would be
grateful for any help.
Christian
--
Christian Schneider <[EMAIL PROTECTED]>
Zentrum f�r Angewandte Informatik --.. .- .. -.-
Universit�tsweiter Service .-. .-. --.. -.-
+ Universit�t zu K�ln + Robert-Koch-Str. 10 + D-50931 K�ln
+ Tel. +49 221 478 7021 +
- DBD::Oracle and Oracle 9i client Christian Schneider
- DBD::Oracle and Oracle 9i client Kevin Bass
