joeferner / node-persist

Node.js ORM framework supporting MySQL and SQLite 3 relational databases.
253 stars 46 forks source link

Fixed ignored connection errors for mysql alpha 2.0 driver #80

Closed andrzejpolis closed 11 years ago

andrzejpolis commented 11 years ago

I found following bug. It applies to alpha 2.0 node-mysql version. I also used connection pools (didn't check if problem exists without them). When calling connect on persist object I never get errors even if database is not responding. There is synchronous connection creation in your code while proper way is to pass a callback. In fact callback is passed but only for logging purposes. I'm not sure this fix won't break anything but it seems to fix my problem.