[Dbix-class] DBI debugging pointer?

Alan Humphrey alan.humphrey at comcast.net
Sat Feb 18 03:34:26 CET 2006


I just ported a command line utility that did things the "old-fashioned" way
using DBI to use DBIx::Class.  The code is much easier to look at and to
maintain.

 

When I run the script against a MySQL back end it runs front to back with no
problems.

 

If I swap out the schema and point to a MSSQL backend (via a Sybase driver)
the main loop craps out after 61 records.  Every time.  Here's the error:

 

DBI
connect('server=seattleaudubon;database=seattleaudubondb','SASAdmin',...)
failed: (no error string) at
/usr/pkg/lib/perl5/site_perl/5.8.0/DBIx/Class/Storage/DBI.pm line 275

 

After tracing the program a while I've discovered that the error is thrown
when we connect to the database for the second time.

 

Here's the loop in question:

 

my $results = $schema->resultset('Urls');

while ( my $row = $results->next ) {

      my $ua = LWP::UserAgent->new;

      $ua->agent('BirdWeb');

      my $req = HTTP::Request->new( GET => $row->url ) ;

      my $res = $ua->request($req);

      my $now = localtime;

      my %columns ;

      $columns{last_checked} = sprintf('%4d-%02d-%02d %02d:%02d:%02d',
$now->year+1900, $now->mon+1, $now->mday,

 
$now->hour, $now->min, $now->sec);

      $columns{last_status}  = $res->code;

      $row->set_columns(\%columns);

      $row->update();

}

 

The error occurs when we need to reconnect for the update.

 

Any ideas on how to approach/debug this?  I'm guessing the reconnect is
failing because we've got an open statement handle for the result set, but I
don't know enough about the internals of DBIx::Class to know for sure.

 

- Alan

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rawmode.org/pipermail/dbix-class/attachments/20060217/ea74c151/attachment.htm


More information about the Dbix-class mailing list