geddy / model

Datastore-agnostic ORM in JavaScript
265 stars 55 forks source link

Fix connection idle timeout #156

Closed eden-lane closed 10 years ago

eden-lane commented 10 years ago

I fixed that problem with disconnecting on idle timeout. My solution is based on official recomendation of node-mysql developers. I'm not sure that fix is necessary for Model, but you can decide it on you own.

mde commented 10 years ago

This looks awesome, but it needs some sort of reconnection limit to make sure it doesn't keep trying to reconnect forever if something's really wrong. Just make sure it doesn't try to reconnect more than RECONNECT_TRIES_LIMIT within some reasonable span of time. (If you want to try it, you could use exponential backoff (http://en.wikipedia.org/wiki/Exponential_backoff) -- it's a pretty common way to handle this.)

ben-ng commented 10 years ago

Do we still need this? It looks like we already have a reconnection test for mysql.

eden-lane commented 10 years ago

Yeah, I've fixed this few month ago. Can't find that pull request, but it was merged.