Subject: | [REQ] ability to define reconnect sub used by 'auto_reconnect' |
Hiya,
I'd like to be able to define the subroutine used when an auto reconnect occurs. The reason being for failover and redundancy: Say I have 3 mysql servers that are read only -- if my connection to one of them times out, instead of just reconnecting to it I'd like to be able to decide which one of the three I should reconnect to, taking things like server load, # connections, etc. into account.
AFAIKS, this would involve making a small-ish change to:
int mysql_db_reconnect(SV* h) {
To allow an external perl sub to be called if set, instead of calling _MyLogin( imp_dbh ). This could be implemented by adding the reconnector sub as another 'attribute' of 'imp_dbh', with the default behaviour being to call a perl sub that just calls _MyLogin().
-Steve