|
|
sybperl-l Archive
Up Prev Next
From: <Sam dot Storie at EmersonProcess dot com>
Subject: DBlib->dbpoll() behaving differently for ASE 12.5.3 w/ Sybperl-2.17 and ASE 15.0.1 w/ Sybperl-2.18
Date: Nov 21 2006 8:41PM
Hello. I have an issue I've noticed when trying to migrate a backup
script I wrote to work with ASE 15.0.1. In my script I use the dbpoll()
function within Sybase::DBlib to monitor the results from a dbcc command
and report if it takes longer than I expect. What's happening is that
when I use sybperl 2.18 built against ASE 15.0.1, the call to dbpoll()
never returns with a result like it's supposed to. To help demonstrate
this I broke this down into a simple perl script:
-----8<-----8<-----8<------
dbpoll_test.pl:
#!/usr/bin/perl -w
use strict;
use Sybase::DBlib;
my (
$dbh,
$dbh2,
$result,
$elapsed
);
$dbh = Sybase::DBlib->dblogin("LOGIN", "PASSWD", "SERVER");
$dbh->dbcmd("waitfor delay '00:00:03'\nselect \@\@version");
$dbh->dbsqlsend();
$elapsed = 0;
while($elapsed < 10) {
sleep(1);
$elapsed++;
($dbh2, $result) = $dbh->dbpoll(100);
if($dbh2 && $result == DBRESULT) {
print "Result completed successfully: $elapsed\n";
$elapsed = 100;
}
}
print "Script done: $elapsed\n";
-----8<-----8<-----8<------
This script should issue a query that waits for 3 seconds, then selects
the version of the server. To monitor the query, I use the dbpoll call
to wait up to 10 seconds and based on the output I can verify that
dbpoll behaved as I expected.
--------------------------
Here's the output when run on my ASE 12.5.3 server.
$ /usr/bin/perl -MSybase::DBlib -e 'print
"$Sybase::DBlib::Version\n"'
This is sybperl, version 2.17
Sybase::DBlib $Revision: 1.59 $ $Date: 2004/06/11 13:04:09 $
Copyright (c) 1991-2001 Michael Peppler
DB-Library version: Sybase DB-Library/12.5.1/P-EBF11758 ESD
#2/DRV.12.5.1.0/SPARC/Solaris 2.8/BUILD1251-002/OPT/Tue Mar 9 18:42:24
2004
$ ./dbpoll_test.pl
Result completed successfully: 3
Script done: 100
--------------------------
The output is telling me that my loop only needed to wait 3 seconds for
the result to appear, which is good. If I run this script, using this
environment, against my 15.0.1 server I *also* get these results (which
is also good).
Now if I change and run the script from within my 15.0.1 environment
against both servers I get results like this:
--------------------------
Here's the output when run on my 15.0.1 server:
$ perl -MSybase::DBlib -e 'print "$Sybase::DBlib::Version\n"'
This is sybperl, version 2.18
Sybase::DBlib $Revision: 1.61 $ $Date: 2005/03/20 19:50:59 $
Copyright (c) 1991-2001 Michael Peppler
DB-Library version: Sybase DB-Library/15.0/P-EBF13716 ESD
#4/DRV.15.0.1/SPARC/Solaris 8/BUILD1500-074/OPT/Mon Jun 5 01:23:01 2006
$ ./dbpoll_test.pl
Script done: 10
--------------------------
As with the first test, I get this same result when I run it against my
15.0.1 and 12.5.3 servers. From what I can tell, all the other aspects
of Sybperl I use work correctly, but dbpoll() isn't.
Anyone have any ideas on what I can try here? Thanks.
-Sam
---
Sam Storie
Database Administrator
Rosemount Incorporated
Emerson Process Management
|