datamapper / do

DataObjects
147 stars 73 forks source link

Connection/Authentication is increadibly slow under JRuby #17

Closed postmodern closed 12 years ago

postmodern commented 12 years ago

I was testing code that would test for weak Database passwords using DataObjects. Under CRuby DataObjects was incredibly fast, able to open/authenticate/close connections almost instantly. Under JRuby, there appears to be a ~5 second delay after a failed authentication. This delay seems to increase with each authentication failure. I'm not sure if this is due to the Java Extensions or to JDBC.

Example Code: https://gist.github.com/1381544

dbussink commented 12 years ago

This is actually a mechanism that JDBC does. The C postgres driver does the same thing as in that it adds delays for failed authentications. Apparently the C mysql driver doesn't do this.

I consider this an implementation detail of the driver, this is not something I want to abstract on manually in DO at the moment. Therefore closing this issue.