in reply to checking whether DBI connection made
try DBI->connect_cached. (like so)
use DBI; ... $dbh=DBI->connect_cached( ... ) or die ...;
After this call your $dbh handle is live and connected and ready to use. If the handle is already connected it just uses that if not it reconnects for you.
Your parameters to the connect must be identical for this to reuse an existing connection (this is normally the case and shouldn't be a problem)
you could even put it in an eval to handle the die condition maybe sleeping and trying again depending on the specific error.
There is also prepare_cached etc.
Enjoy
|
|---|