Hello Monks,
I'm writing some code that makes database connections for me, I want it to be robust enough to retry the connection if it fails without having to wait the default DBI timeout period.
Is it possible to set the timeout value for DBI::connect()? If not, is it safe to alarm out of a connect(), or is there a better way? The pod does discuss alarm signals, but does not describe using them with a connect().
Also, do DBI database handles have a method to test if the connection to the database is active? I'd like to be able to do this both to make sure my connection was successful and also later to make sure the connection didn't drop. I'm assuming that since Apache::DBI is smart enough to re-create connections whenever they drop that it must have some way of doing this.
Thanks for any help!
In reply to DBI Timeout and Retry on Connect by ehdonhon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |