in reply to Preventing database handles from going stale
Then call that before every query...note that this is untested code.sub db_keepalive { # if connection is dead if(!$dbh->ping) { # reopen it $dbh = DBI->connect_cached($data_source, $username, $password, \%a +ttr) or die $DBI::errstr; } }
__________
The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it.
- Terry Pratchett
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Preventing database handles from going stale
by dsheroh (Monsignor) on Feb 05, 2007 at 17:31 UTC | |
by EvanK (Chaplain) on Feb 05, 2007 at 17:41 UTC | |
by dsheroh (Monsignor) on Feb 05, 2007 at 17:50 UTC | |
by EvanK (Chaplain) on Feb 05, 2007 at 18:04 UTC | |
by dsheroh (Monsignor) on Feb 05, 2007 at 18:20 UTC | |
|