ActiveRecord::ConnectionTimeoutError (could not obtain a database connection within 5 seconds. The max pool size is currently 30; consider increasing it.):
之前它被设置为5,我们已经将其增加了,现在没有办法同时使用30个连接。我们只使用ActiveRecord来存储会话。
我们的database.yml文件如下:
development:
adapter: sqlite3
database: db/development.sqlite3
pool: 30
timeout: 5000
测试和生产环境的设置是相同的。
我一直在搜索这个问题,并刚刚发现了这篇文章:
https://groups.google.com/forum/#!msg/copenhagen-ruby-user-group/GEHgi_WudmM/gnCiwWqmVfMJ
其中提到 ActiveRecord 在完成连接后不会检查连接是否归还到池中?这是真的吗?我需要手动管理连接吗?
感谢任何建议!
编辑:我应该提到我正在运行Rails 3.1.3
activerecord-jdbc-adapter使用版本1.2.2
,activerecord-jdbcsqlite3-adapter使用版本1.2.2
和jdbc-sqlite3使用版本3.7.2
。 - Krista