pysome has asked for the wisdom of the Perl Monks concerning the following question:
In the sub do_stomthing(),i execute some SQL operation.But how to check the $dbh's status in do_something()?$dbh=DBI->connect() .... while(1) { do_something(); }
My aim is only to reduce the spending of DB connection.sub do_something() { if($dbh's status is false) { $dbh=DBI->connect().... } }
Any help will appreciated!
Thanks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to check the $dbh's status
by bart (Canon) on Jul 18, 2007 at 10:27 UTC | |
|
Re: How to check the $dbh's status
by perrin (Chancellor) on Jul 18, 2007 at 15:10 UTC | |
by pysome (Scribe) on Jul 19, 2007 at 05:26 UTC | |
by perrin (Chancellor) on Jul 19, 2007 at 14:39 UTC | |
by pysome (Scribe) on Jul 20, 2007 at 02:09 UTC | |
|
Re: How to check the $dbh's status
by Akoya (Scribe) on Jul 18, 2007 at 14:32 UTC | |
|
Re: How to check the $dbh's status
by sago (Scribe) on Jul 19, 2007 at 10:08 UTC |