1

I have something running constantly doing periodic queries. I have used both DataMapper (though I'm doing raw SQL through it) and mysql2.

Using either, occasionally they stop working. I believe it's because the server hiccuped or something.

Nonetheless, everything grinds to a halt, then. Execution on each thread just stops at the query line and that's the end of that.

Is there a way to tell them to reconnect? Or, failing that, can I do it myself. I've been trying using timeout, but timeout seems to sort of freeze as well (it enters the block and never leaves, neither via raising an error nor through natural completion).

I simply want the queries, if they fail, to pass on by and on the next time around, try again, reconnecting to the server if necessary. How can I do this?

Hsiu Dai
  • 1,303
  • 2
  • 14
  • 21
  • Not sure about DataMapper, but can you pass the option ":reconnect => true" to your Mysql2::Client, when you are instantiating it? – Marco Lazzeri Oct 13 '11 at 13:01

0 Answers0