Been a long time since I tried that, I'll give it another go.
I've seen people complain about it before, but it seems really strange
that there isn't an easy way to force active-record to reconnect after a
disconnect.
From script/console, the following works.
Mymodel.new.save #works
Mymodel.connection.disconnect!
Mymodel.new.save # toss an error.
Mymodel.connection.reconnect!
Mymodel.new.save # works
Yet the equivalent doesn't seem to work in a long running script.