RE: Perl DBI->Connect: how to detect a a lost connection

2008-07-21 Thread Stewart Anderson
Ravi Malghan wrote: > Hi: I have a script which connects to a database when it starts up > > $dbh = DBI->connect("dbi:Pg:dbname=$dbname;host=$host;port=$port;", > "$username", "$password", {AutoCommit => 1}); > > followed by a while loop which runs a query for this connection at 60 secon

Re: Perl DBI->Connect: how to detect a a lost connection

2008-07-20 Thread Rob Dixon
Ravi Malghan wrote: > Hi: I have a script which connects to a database when it starts up > > $dbh = DBI->connect("dbi:Pg:dbname=$dbname;host=$host;port=$port;", > "$username", "$password", {AutoCommit => 1}); > > followed by a while loop which runs a query for this connection at 60 second

Re: Perl DBI->Connect: how to detect a a lost connection

2008-07-20 Thread jeff pang
Apache::DBI has the built-in ping method which was used to check if a connection is alive. You may referer that. On Mon, Jul 21, 2008 at 7:14 AM, Ravi Malghan <[EMAIL PROTECTED]> wrote: > Hi: I have a script which connects to a database when it starts up > $dbh = > DBI->connect("dbi:Pg:dbname=$db