guha has asked for the wisdom of the Perl Monks concerning the following question:
I have a couple of programs which access different remote databases distributed in our wan. The programs are invoked in a cronish manner several times a day. The communication is done with tcp/ip over fixed 2Mb lines.
Lately there has been a lot of problems with the reliability of those links, related to HW-failure at the link provider and excavators cutting the backbone fiber, etc, etc.
Until recently I didn't think this was a major problem with the application, because if the program failed with a timeout due to the broken link, then DB's would be resynced on the next time the programs starts with a functional link
However, here's where I spotted an, to me anyways, odd behaviour of possibly DBI and/or DBD::ODBC.
Consider this scenario
The fix:
What I did was to use Net::Ping to test wheter the link was up before invoking the connect method of DBI. This does however not handle the case where the link goes down during a connection, and the previous scenario could very well occur again.
More info
Program fail on Win2000 and
WinXP
AS perl v 635
DBI v 1.37
DBD::ODBC v 1.05
Also I'm using DSN's to connect.
my $dbh = DBI->connect("DBI:ODBC:$dsn") or die "Could not connect to $dsn >> $DBI::errstr\n";
I have tried to find something related through google and one of the mailing-list archives for DBI, but no avail.
Question:
As I'm totally stumped by this, I welcome any input to the problem.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Timeout problems with DBI
by zakzebrowski (Curate) on Sep 10, 2003 at 11:40 UTC | |
|
Re: Timeout problems with DBI
by jdtoronto (Prior) on Sep 10, 2003 at 12:29 UTC | |
|
Re: Timeout problems with DBI
by monktim (Friar) on Sep 10, 2003 at 12:45 UTC | |
|
Re: Timeout problems with DBI
by liz (Monsignor) on Sep 10, 2003 at 10:43 UTC | |
|
Re: Timeout problems with DBI
by guha (Priest) on Sep 11, 2003 at 12:45 UTC | |
by iburrell (Chaplain) on Sep 11, 2003 at 20:00 UTC | |
by zakzebrowski (Curate) on Sep 11, 2003 at 13:11 UTC |