When dealing with persistant MySQL connections, the one problem is that they get dropped after a certain timeout (usually 28800 seconds). DBIx::Connector seems to do the job of automatically reconnecting to a dropped connection, but it adds more Perl code to each SQL statement which can get annoying. For example instead of:
$dbh->do('DROP DATABASE stackoverflow');
One has to say:
$conn->run(
fixup => sub {
my $dbh = shift;
$dbh->do('DROP DATABASE stackoverflow');
}
);
Suppose one does not need transactions. Why would one want to use DBIx::Connector instead of passing $dbh->{mysql_auto_reconnect} = 1, which also works well?