Subject: | ping method throws exception if no connection |
A user of my Dancer::Plugin::Database raised an issue experiencing problems when using DBD::SQLAnywhere - D::P::D uses the ping method to check that the database connection is still alive, but the simple implementation in DBD::SQLAnywhere will result in an exception if the connection is dead.
As the ping method is one expressly designed to be called to find out whether the connection is alive, I feel it should catch the exception itself, and simply return 1 or 0 to indicate whether the connection is usable or not - what do you think?
I don't mind working round it in D::P::D if required, but I think the better place to fix it is within DBD::SQLAnywhere so it fixes it for all users of this database driver.
The issue raised for D::P::D is at:
https://github.com/bigpresh/Dancer-Plugin-Database/issues/65